You're most welcome.
With regard to the "race condition" suggested here. It's a red herring!
The description:
- worker thread dequeues last item
- main thread checks pending (false)
- main thread checks number of busy threads (none)
- main thread signals workers to end
- worker marks itself busy
- worker starts processing last item
fails to consider what happens at this point.
- once the worker processing the last item finishes, it loops back to check for another, gets undef, exits the loop and terminates.
- and the main thread, waiting on the join, sees it terminate and completes. Clean exit. Job done.
There is simply no need for the over-engineered, overcomplicated solution suggested.
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.