I am using threads and I want the main thread to give some time to its workers. The main thread enqueues work for them and I don't want the queue to get too big. The docco says: You may do use threads qw(yield), and then just use yield() in your code. I am using it in the main thread with no errors but I am not sure it is doing anything.
At this point I am early in development and there is not much load on my system. If yield is not working in the main thread would doing a uSleep have a similar effect? Any other suggestions on an efficient way to keep the queue full but not too full?
Cheers,
R.
In reply to Does the main thread yield? by Random_Walk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |