Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Monitoring child threads

by TOD (Friar)
on Jan 24, 2008 at 12:55 UTC ( [id://664003]=note: print w/replies, xml ) Need Help??


in reply to Monitoring child threads

if you're really talking about threads and not processes, the SIGCHLD advice would be rather senseless. in this case you should consider implementing a handler for $SIG{__DIE__} in your main thread and localizing a hook for it in the child threads. e.g.:
# main thread: sub sig_die_handler { my $message = shift; warn $message; } [...] # child threads: local $SIG{__DIE__} = sub { &::sig_die_handler(shift) };
or something like that. anyway, this is roughly the way to achieve what you have in mind - if we're really talking about threads.
--------------------------------
masses are the opiate for religion.

Replies are listed 'Best First'.
Re^2: Monitoring child threads
by roboticus (Chancellor) on Jan 24, 2008 at 13:23 UTC
    TOD:

    D'Oh! I guess I should've engaged brain before typing.... ;^O

    Thanks for the catch. I saw threads and thought processes....

    ...roboticus

Re^2: Monitoring child threads
by weismat (Friar) on Jan 24, 2008 at 13:38 UTC
    We are talking about detached threads which communicate via queues(Thread::Queue) to each other.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://664003]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2024-04-23 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found