in reply to Re: Concurrent Processes
in thread Concurrent Processes

I see what you are saying.
Acutally, I think the first part of what you said may be the cause of the problem, I'm still ending up with this running in SERIAL with the waitpid() inside the for loop.

But I'm unclear as to how your code can be used to do what I need. The parent needs to be able to see what the child puts out. Since I'm no longer doing the 2-way pipe that was set up, where does the child give it's data back to the parent process? You threw in comments about 'child stuff' and 'gather children', but your design changes the way it all works. Could you be more clear about that?

Replies are listed 'Best First'.
Re: Re: Re: Concurrent Processes
by mpeppler (Vicar) on Oct 21, 2003 at 18:37 UTC
    I think you should look at the select() call to check for output from your various children.

    May I recommend going to a bookstore and purchasing Stevens' Unix Network Programming? This will have a lot of examples about how to do this sort of thing, coded in very clear C.

    Michael

      Ya know, I was trying to look at select() for that before, but I'm still having some difficulty finding any good examples that can clearly show me how it's used. I've seen a couple, but they mostly cover with use of sockets. I'd rather like to avoid that route if I can.

      Know of any good resources in Perl for that?
Re: Re: Re: Concurrent Processes
by ptkdb (Monk) on Oct 21, 2003 at 18:35 UTC
    That bit of code was only addressing the launching and gathering of child processes. I can't/won't/shouldn't work out everything for you.
      Contradicting everything in my previous post, I've 'slapped together' a process manager object and posted in the code section ProcessMgr