Another Python Cookbook recipe submission. This one is strikingly similar to the tuple space code I wrote a while back.
I actually wrote it because I needed a MultiQueue class to make a more efficient ActiveObject that would multiplex on several message queues using the threads in a thread pool.
The aim here is to support a large number of concurrent objects without having to have a large number of threads, based on the assumption that not all of the objects are going to be processing messages from each other all of the time. Every object still has its own dedicated message loop, but this loop is now activated by multiplexing thread-pool threads rather than owning its own thread. If the thread pool contains 5 threads, then you can have 5 actions in progress concurrently with the other ActiveObjects on stand-by for when a thread becomes available.
I have a feeling that Stackless Python makes these sorts of trade-offs moot…