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

Class ThreadPool

source code

object --+
         |
        ThreadPool

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

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

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.

Overrides: object.__init__