anonymous pipes



hi group,

i am very new to mfc. and trying to communicate via ipc with the child
process.
but some things i didnot understand after reading the documents.


1) redirecting input and output of the child process i have to use two
pipes
--because it anonymous pipe is only one directional so that for data
to child process one pipe
--and for data from child process another pipe.(understood)

2)the child process inherits the handles so before creating child
process make duplicate copies of that hadle.(i didn't got this
point.)from what i read they say that child should not inherit that
handle.

3)
and actually i am to send the data to child and then able to get his
reply depending on that data for only one time.
if i want to do this untill some event then how i can do this?
means if
parent say's "hello child" then child should respond "hello
parent"
then if parent say's "help" then child "result"
like this untill parent says stop then child will get killed.
so for doing this do i need to handle synchronization?

4)and after every writefile do i need to make a call to CloseHandle();
and if i closed the handle then how i will communicate with child next
time

5) general architecture i want to develope

parent
child


p1

------------------------------------------------------->



p2

<----------------------------------------------------------

architecture

parent
child
step in

--------------------------------------------------------->
respective result

<---------------------------------------------------------


step out

----------------------------------------------------------->
respective result

<---------------------------------------------------------


stop

---------------------------------------------------------------->

will end



(main thing i want to do is that parent should be able to send request
multiple times and then child should respond multiple times)

how to do it?can i do it without threading?
please suggest a good method because i am doing IPC for first time.


Regards &Thanks
Harshal shete

.



Relevant Pages

  • Unix Programming FAQ (v1.37)
    ... Why use _exit rather than exit in the child branch of a fork? ... Why doesn't my process get SIGHUP when its parent dies? ... How do I create a named pipe? ... How do I compare strings using regular expressions? ...
    (comp.unix.programmer)
  • Unix Programming FAQ (v1.37)
    ... Why use _exit rather than exit in the child branch of a fork? ... Why doesn't my process get SIGHUP when its parent dies? ... How do I create a named pipe? ... How do I compare strings using regular expressions? ...
    (comp.unix.programmer)
  • Unix Programming FAQ (v1.37)
    ... Why use _exit rather than exit in the child branch of a fork? ... Why doesn't my process get SIGHUP when its parent dies? ... How do I create a named pipe? ... How do I compare strings using regular expressions? ...
    (comp.unix.programmer)
  • Unix Programming FAQ (v1.37)
    ... Why use _exit rather than exit in the child branch of a fork? ... Why doesn't my process get SIGHUP when its parent dies? ... How do I create a named pipe? ... How do I compare strings using regular expressions? ...
    (comp.unix.programmer)
  • Unix Programming FAQ (v1.37)
    ... Why use _exit rather than exit in the child branch of a fork? ... Why doesn't my process get SIGHUP when its parent dies? ... How do I create a named pipe? ... How do I compare strings using regular expressions? ...
    (comp.unix.programmer)