Grand Central in Snow Leopard
Apple has released some more details on the Grand Central Dispatch multi-core code scheduling platform. I'll have to read more and think about it a bit, but I have to say that seeing a lambda syntax decorator in C code is a bit of a mind-bender.
From the reddit thread:
What makes this stuff cool is that it's shifted the abstraction away from threads. The new abstraction is a queue, which is a lightweight list of work (blocks) to be processed serially (with respect to other work on the list). What makes this really cool is that it is easy and very fast for one queue to make work for another.
For example, let's say you want to construct a bunch of objects in parallel and put them all into a set. With an ordinary worker pool, you would make a lock to protect the set, and then each thread would compute its object, acquire the lock, add the object to the set, and then release the lock.
But with GCD, you would make a queue for the set. Each thread would then compute its object, but submit a block to the set's queue responsible for adding the object to the set. Because the queue processes its blocks serially, there's no need to lock. And because the usual way to submit a block to a queue is asynchronous, deadlock becomes impossible.
Want to get something out of the set? Tell the set's queue to get the object out, and then call your queue back with the object. And happily, the syntax for this stuff doesn't suck - you can define the code you want to happen on another queue inline.
So this ultimately isn't about thread pooling. It's about changing the abstraction away from threads. If you need a point of reference, think of it like the actor model, where the actors are queues.