Package SCons :: Module Job :: Class ThreadPool
[hide private]
[frames] | no frames]

Class ThreadPool

source code

This class is responsible for spawning and managing worker threads.



Instance Methods [hide private]
 
__init__(self, num, stack_size, interrupted)
Create the request and reply queues, and 'num' worker threads.
source code
 
put(self, task)
Put task into request queue.
source code
 
get(self)
Remove and return a result tuple from the results queue.
source code
 
preparation_failed(self, task) source code
 
cleanup(self)
Shuts down the thread pool, giving each worker thread a chance to shut down gracefully.
source code
Method Details [hide private]

__init__(self, num, stack_size, interrupted)
(Constructor)

source code 
Create the request and reply queues, and 'num' worker threads.

One must specify the stack size of the worker threads. The
stack size is specified in kilobytes.