C-Help: Talk to many child-proceses.

C-Help: Talk to many child-proceses.

Post by Ian Collin » Sat, 30 Jan 1999 04:00:00




> I need to write a c-program that gives orders and get results back from many
> child processes. I don't want the parent process to have to wait while the
> child prepairs the data. I want it to be able to deal with another child and
> then, later when the first child's response is ready, go back and retrieve
> it.

> I guess I have some choices to make here:
> * Should I fork or should I start a new independent process?
> * How should I communicate between the processes? pipe, fifo or sockets?
> * How will I know when the child-processes are ready to send?

It sounds like you would be better of with threads.  What sort of action
are
the child processes doing?

At least with threads you don't have to bother with IPC and they can all
share data.  A simple mutex protected queue can be used to pass messages
back to the 'main' thread.

        Ian

 
 
 

1. Getting a child and child's child process-id

 Why not just have the parent fork twice ??? Saves a lot of trouble ...
--


#  Have you read your Book In Basic Life Education today ? You should !!  #
#  Any views I express are not necessarily those of Brighton Polytechnic  #
###################### "surivorter erutangis a ma I" ######################

2. problems configuring serial ports, any help?

3. how to create a user, which can't be su'd to ?

4. C++, forking, and talking between parent/child processes

5. Looking for LINUX HELP!

6. parent talking to a bunch of child processes...

7. Endless segfaults under 1.3.xx: Why?

8. ntalk 5.4 on Sun will not talk to DEC 5000/240 Ultrix talk - Help

9. child's child redirection

10. child process, child program

11. How to create memory in ptraced child process w/o child source code

12. kill child and its all grad child processes?