Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: choosing threads

by weismat (Friar)
on Feb 19, 2009 at 16:24 UTC ( #745109=note: print w/ replies, xml ) Need Help??


in reply to Re: choosing threads
in thread choosing threads

If I understand this correctly, then he intends to send the same data to every thread. Thus it is not really the traditional Boss/Worker pattern as every worker will perform the exact same (not similar) task.
I have had a similar requirement with realtime data and I did not manage to get this working as unfortunately there is no way to have a shared array of Queues.
Only way would be to store the read data in memory before starting with the threads, but this means a lot of memory consumption, which will be high already with 100 threads. Update: I would be interested i there is a decent way to achieve a shared array of Queues.


Comment on Re^2: choosing threads
Re^3: choosing threads
by zentara (Archbishop) on Feb 19, 2009 at 16:28 UTC
    No, the data sent to each thread at the beginning of a run is different, and shifted off of an array or something. The key is for efficiency...STOP multiple spawning and/or forks...and reuse the threads, just reset them and refill with fresh data to be processed. We may be misunderstanding the fine points of what he is attempting, but reusing threads is the best for efficiency.

    I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2014-07-30 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (235 votes), past polls