top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is a names Pipe and how is it different from regular pipes?

+3 votes
434 views

Any C implementation of named pipe would be helpful?

posted Sep 22, 2015 by Mishthy Mukherjee

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Named pipes are in fact FIFO's. These are persistent objects represented by nodes in the file system. A named pipe provides many-to-many, two-way communication between one or more processes that are not necessarily related and do not need to exist at the same time. The file name of the pipe serves as an address or contract between the processes for communication. If only one process writes to a named pipe and one other process reads from the named pipe, then the named pipe behaves in the same way as an unnamed pipe between the two related processes.

So the short answer is that you need a named pipe for communication between unrelated processes that might not exist at the same time.

Named pipes have three advantages:

1.) You don't have to start the reading/writing processes at the same time.
2. ) You can have multiple readers/writers which do not need common ancestry.
3.) As a file you can control ownership and permissions.

Regular pipes provide a means of one-to-one, one-way inter process communication between different processes that are related by either a parent-child relationship, or by being children of a common parent that provides the pipe, such as a shell process. Because the processes are related, the association of file descriptors to the pipe can be implicit and does not require an object with a name that is external to the processes.

answer Nov 22, 2015 by Amit Kumar Pandey
Similar Questions
+1 vote

I was searching the differences in normal C-lang multithread program and a multicore programming. Can any one clarify the difference and how the "parallelism" OR "execution-speed" is achieved form multicore programming.

Using the thread attribute we can set the affinity(in which core he has to run) to the thread, not not getting the exact usage of multicore programming.

One more question how to access the common(global data) memory in multicore programming, will synchronization adds delay in execution? If yes then what is the use of multicore programming

...