Explain difference between IPC mechanisms

ipc mechanisms are mianly 5 types
1.pipes:it is related data only send from one pipe output is giving to another pipe input to share resouses pipe are used drawback:itis only related process only communicated
2.message queues:message queues are un related process are also communicate with message queues drawback:user dont know which process curently works share memory:memory shared in distributed systems some memory wants to share some files that time it is use full semaphores semaphore is integer type and in semaphore resourses give coding like negetive value means process are wants to use perticular resource waiting only and 0 means no process is waiting and 1 means one resource is free and sockets:sockets also ipc it is comunicate clients and server with socket system calls connection oriented and connection less also PIPE: Only two related (eg: parent & child) processess can be communicated. Data reading would be first in first out manner. Named PIPE or FIFO : Only two processes (can be related or unrelated) can communicate. Data read from FIFO is first in first out manner. Message Queues: Any number of processes can read/write from/to the queue. Data can be read selectively. (need not be in FIFO manner) Shared Memory: Part of process's memory is shared to other processes. other processes can read or write into this shared memory area based on the permissions. Accessing Shared memory is faster than any other IPC mechanism as this does not involve any kernel level switching(Shared memory resides on user memory area). Semaphore: Semaphores are used for process synchronisation. This can't be used for bulk data transfer between processes.

No comments: