On Sunday 14 September 2008 03:24:53 Robert Klemme wrote:

> The usual solution is that the queue will not "go out of scope" before 
> the thread dies.

Right.

> In a farmer worker scenario (or however you call it)  
> the farmer distributes work and is also often responsible for collecting 
> results.  If there is no work left he needs to notify workers of this 
> fact so they can react appropriately (die).

I'd like to detect "no work left" as a case of the "farmer" going out of 
scope, if possible.

So, it sounds like you're telling me all the "usual" ways of doing this.
Is there no way to make my suggestion work?