|Perl: the Markov chain saw|
If you post the full code -- or better, a cut-down but runnable version of it -- I'll take a look at this, but I'm not going to waste time trying to re-create your code from your description.
Update: I suspect the problem is that you are trying to do the scheduling yourself, instead of allowing the well-designed and highly evolved scheduler in your operating system do what it is designed to do.
Using a semaphore in conjunction with a queue does not make a lot of sense on the surface of the scant description you've provided; but I'm reserving judgment until I've seen something I can run.
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.