Random_Walk has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Does the main thread yield?
by BrowserUk (Patriarch) on Apr 24, 2013 at 07:40 UTC | |
by Random_Walk (Prior) on Apr 24, 2013 at 08:20 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |