From: Alex Young Date: 2007-01-26T02:47:31+09:00 Subject: Re: Class.new ? Robert Klemme wrote: > On 25.01.2007 18:02, Alex Young wrote: >> Avdi Grimm wrote: >>> The first example off the top of my head: >>> >>> A class which might return an existing object out of an object pool, >>> instead of returning a new object. >> Ooh... Has anyone written a ThreadPool which works that way? That >> would be nice :-) > > I don't think this is the right pattern for a thread pool. There you > usually start all the threads and let them fetch tasks from a single > queue. Taking threads out of a pool and into a pool seems much more > complex especially since you want to block inactive threads. The queue > variant is much simpler. Or did you have something else in mind? Not really - just wondering what it would look like :-) I might have a play later, and see if it makes any sense. -- Alex