On Thu, 2003-11-27 at 21:37, drieux wrote:
> 
> On Thursday, Nov 27, 2003, at 09:58 US/Pacific, Douglas Lentz wrote:
> 
> > Re: (A) What's the best way for the child to inform the parent that 
> > it's done?.
> >
> Given that his question (A) is about 'informing'
> the parent that it is finished, he might really
> want to look at
> 
>       perldoc -q signal
> 
> and specifically set up a sig handler for setting up
> a SIGCHLD so that he can set a flag,
> 
>       my $all_my_children = {};
> 
> where the pid that would be returned from the fork,
> which would of course need to be picked up, is recorded.
> 
> cf perldoc perlipc
> 
> and look for 'sub REAPER'
> 
> Then in the main loop check the status of "all_my_children"
> to see if any of them have changed - and if so editorialize.
> This of course means that the long_activity will need to
> exit with say 0 if ok, or some number if not good, and the
> initialization would be say
> 
>       $all_my_children->{$pid} = 'A';
> 
> and as a part of the loop to check the status, one
> gets the return value and then deletes it from the hash.

Thanks for this tip - I will take a look into the topics you have
mentioned, but it sounds very promising. :-)

> This may also help with the 'B' side question -
> as well without getting into the more complex
> set of issues of doing the pipe(), fork()
> manage the multiple selects that would need to
> poll through the long_activities to see if
> new incoming data needs to be collected, or
> is the primate banging on the keyboard.
> 

Though I do not know yet how the first part will work, I honestly do not
understand how a solution to A might help me with the second part of my
question. Could you explain this more detailed?

The danger of primates banging on keyboards is - of course - always
existent and quite high, but in this case I would settle for a first
version that would be usable by more or less normal beings of the
species homo [EMAIL PROTECTED] - v 2.0 would then focus on the keyboard-banging
primates, managers, sales-people etc. ... ,-)

Thank you very much for your help,

Philipp



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to