Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Does the main thread yield?

by BrowserUk (Pope)
on Apr 24, 2013 at 07:40 UTC ( #1030294=note: print w/replies, xml ) Need Help??

in reply to Does the main thread yield?

Any other suggestions on an efficient way to keep the queue full but not too full?

Try my self-limiting queue implementation from the spoiler in Re^4: dynamic number of threads based on CPU utilization.

Set the size to at least 4 times the number of elements as you have consumer threads and then adjust up and down until you hit the sweet spot for your application.

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.

Replies are listed 'Best First'.
Re^2: Does the main thread yield?
by Random_Walk (Prior) on Apr 24, 2013 at 08:20 UTC

    Thank you. I will be using that, a much more elegant solution


    Pereant, qui ante nos nostra dixerunt!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030294]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2018-02-19 02:25 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (257 votes). Check out past polls.