I'm pleased to announce the release of threadpool.py version 0.9, released under the GNU LGPL.
threadpool.py can be obtained from:
Release Name: 0.9
Notes: This module uses the threading and Queue modules to create a pool of reusable threads.
After creating an instance of ThreadPool, one queues functions to be excecuted. The pool dispatches the functions to the waiting threads, which call them.
When queueing a function on the pool with *pool*.put(), an instance of ReturnValue is returned. ReturnValue is a subclass of functional.Lazy, and can be used in any context that a regular lazy expression can. When evaluating a ReturnValue, the evaluating thread will block until the other thread has completed its work and loaded the return value of the function into the ReturnValue instance.
VLocks are an alternative to RLocks which include a visible queue threads waiting for the lock.
lock, unlock, getLockFor, and deleteLockFor work with a module-level dictionary of objects to locks, and can be more convenient than working with lock objects directly.
Locked and Async are callable wrappers around a function. Async calls return immediately after queueing their function on a thread pool, while Locked calls first acquire the lock they were passed on creation, call their function, and release the lock.
Changes: 10/18/2000: Release 0.9 Fixed endless loop bug when an exception was raised.
10/12/2000: Move to SourceForge, release 0.8
-- Bryn Keller firstname.lastname@example.org