[Python-Dev] threadtools (was Re: Autoloading? (Making Queue.Queue easier to use))

Aahz aahz at pythoncraft.com
Thu Oct 13 19:08:17 CEST 2005


On Thu, Oct 13, 2005, skip at pobox.com wrote:
> 
> Given your list of stuff to go in a threadtools module, I still think
> you need something to hold Lock, RLock, Condition and Semaphore.  See
> my previous post (subject: Threading and synchronization primitives)
> about a threadutils module to hold these somewhat lower-level sync
> primitives.  In most cases I don't think programmers need them.  OTOH,
> providing some higher level abstractions seems to make sense.  (I
> have to admit I have no idea what a QueueThread's outbox queue would
> be used for.  Queues are generally multi-producer, single-consumer
> objects.  It makes sense for a thread to have an inbox.  I'm not so
> sure about an outbox.)

If you look at my thread tutorial, the spider thread pool uses a
single-producer, multiple-consumer queue to feed URLs to the retrieving
threads.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair


More information about the Python-Dev mailing list