Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: dynamic number of threads based on CPU utilization

by mabossert (Beadle)
on Sep 26, 2012 at 16:31 UTC ( #995812=note: print w/ replies, xml ) Need Help??


in reply to Re: dynamic number of threads based on CPU utilization
in thread dynamic number of threads based on CPU utilization

Thanks for the feedback with the bi-gramming. It turns out, I can simply store the bi-gram array directly as part of the hash...I will give that a shot later today and see how it does.


Comment on Re^2: dynamic number of threads based on CPU utilization
Re^3: dynamic number of threads based on CPU utilization
by BrowserUk (Pope) on Sep 26, 2012 at 16:38 UTC
    it turns out, I can simply store the bi-gram array directly as part of the hash..

    That will work, but be aware that accessing the data in a shared data structure is significantly slower than accessing non-shared memory. This is due to the need for internal locking amongst other things.

    So if you run a second pool of threads, each accessing that shared hash containing shared arrays, the lock contention between the threads will likely slow your processing to a crawl. (A simple fact of life with perl's shared data structures).

    Try the version I posted and see how you get on.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-09-20 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls