[LCP]InterProcess Communication

NC Designs robert at ncdesigns.net
Sun Nov 24 09:24:37 UTC 2002


bidirectional pipes can be created using two pipes. They are not fun and can
be more difficult then using expect. I've used them to program an online
spell check application.

You need use the pipe() system call twice to allocate two pipes before
creating your child process.
In the child process you attach the output end of the first pipe to stdout
using dup() then you do the same on the parent in the reverse, you have to
be sure to closed the unused portions of each pipe. make sure you don't have
any deadlocks by maybe using select() or mutexs to provide primative
syncronization.

I hear that Linux supports bidirectional pipes, but the above method should
be more portable.

----- Original Message -----
From: "mehul radheshyam choube" <mrc_cprog at rediffmail.com>
To: "Y Giridhar Appaji Nag" <Giridhar.Nag at ubinetics.co.in>
Cc: <linuxcprogramming at lists.linux.org.au>
Sent: Tuesday, November 19, 2002 8:10 AM
Subject: Re: RE: [LCP]InterProcess Communication


> >What you would like to do is probably better done using expect.
>   i would not like to do it using expect. i would
> like to try bidirectional communication. but i m newbie
> to IPC so would be helpful if anybody commes with a
> decription on how bidirectional communication is done?
> what precautions should be taken?, ...
>
>   online docs on bidirectional communication will
> be of great help.
>
> mehul.
>
> __________________________________________________________
> Give your Company an email address like
> ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
> Know more. http://www.rediffmailpro.com/signup/
>
> _______________________________________________
> This is the Linux C Programming List
> :  http://lists.linux.org.au/listinfo/linuxcprogramming List




More information about the linuxCprogramming mailing list