ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all! I was wondering if someone could give me an example of the usage of named pipes for communication of father with multiple children processes in c code. Thanks in advance
well, that is an example of how simple it is if you can do it with shell.
is the communication two way or one way?
well assume it's two way you must have two FIFOs per pair,
parents read/write child write/read which is 6 pipes.
but then the parent will probly need to use select to check which is ready.
(A pipe can only connect with ONE reader and ONE writer at a time)
or, you could have one pair of FIFOs and say use the PID of the child as an
IP address as it were to prepend each message,
simpler solution.
is this homework?
Last edited by bigearsbilly; 12-07-2007 at 08:59 AM.
an interesting use for a FIFO often seen in books, is for your
mail .signature file (if this applies).
you replace it with a FIFO and a serving process that gives a
random quote (often the fortune program) every time the
FIFO is read, nifty eh?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.