Is there a threading model that works something like the following:
while thread = nextAvailableThread():
thread.doWork(data)
Such that when a thread is finished it triggers nextAvailableThread() to return this thread that just finished. This model would make distributing uneven data chunks between threads much easier as you could just pass on the next chunk of data to the next available thread and produce near-optimal data distribution.
I'm particularly interested in using this in C++, but I'd be happy to here of anything like this exists in any language?
EDIT: Thread pool looks just like what I was thinking of. So, any recommendations for C++ implementations?