Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Dormus interruptus

by fluxion (Monk)
on Jun 25, 2004 at 04:47 UTC ( [id://369550]=note: print w/replies, xml ) Need Help??


in reply to Dormus interruptus

I'm not sure how well this addresses the cleanliness issue (correction: it doesn't. i thought a detach() would allow a thread to die "cleanly", but that's not the case), but instead of having the threads wait for 'q', you could simply check for 'q' in main, detach() the threads once it's read, then exit the script.

Roses are red, violets are blue. All my base, are belong to you.

Replies are listed 'Best First'.
Re^2: Dormus interruptus
by pbeckingham (Parson) on Jun 25, 2004 at 12:57 UTC

    I tried this one, but it seemed untidy in that the threads, once detached, would continue, and get killed when the parent exits. I was looking for some way to do this without resorting to letting Perl itself clean up after me.

Log In?
Username:
Password:

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

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

    No recent polls found