Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Two threaded program

by zwon (Abbot)
on Oct 11, 2011 at 14:44 UTC ( [id://930835]=note: print w/replies, xml ) Need Help??


in reply to Two threaded program

I don't see why you can't do this all in one thread, as tasks are not parallel, but here's a couple of notes. Instead of checking variable value in a loop, use cond_wait and cond_signal (see threads::shared). Wrap read/write loop into eval block, so you could catch any errors and still send signal to waiting thread to exit.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-16 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found