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

Re: Synchronising threads with signals (or not)

by Anonymous Monk
on Feb 22, 2013 at 16:54 UTC ( #1020191=note: print w/replies, xml ) Need Help??


in reply to Synchronising threads with signals (or not)

You need to design your application so that the two processes don't have to "start at a similar time to one another." Each one should have a job to do and should wait for a signal unique to them that indicates that they might have work to do ... i.e. that they should not be asleep anymore. Each one, upon waking up, immediately resets the signal they were sleeping for, then processes a work-to-do queue until that queue is empty. Or perhaps the process just "waits on the queue" as needed using semantics already built into the thread-safe-queue object. Each thread of a multithreaded application should not be in any way dependent on what else is happening in any other thread and should be free to pursue whatever its appointed task is, as fast as it can.
  • Comment on Re: Synchronising threads with signals (or not)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020191]
help
Chatterbox?
[Discipulus]: The Count of Moret; The Red Sphinx is a single book appeared with different titles. it is one of the best and alot of understimed Dumas book.
choroba has only read the first two
[Discipulus]: if i can suggest La Reine Margot too is a great book and obviously The Count of Monte Cristo that is a chef-d'œuvre
[Discipulus]: The red sphinx is about Rechilieu, absolutely thrilling
[erix]: thanks, Discipulus - I got them lined up at gutenberg :)
[erix]: I red the musketeers and Monte Cristo but both a very long time ago (many decades ago)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-05-24 07:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?