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.
In reply to Re: Does the main thread yield?
by BrowserUk
in thread Does the main thread yield?
by Random_Walk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |