Package solvcon :: Module mthread :: Class ThreadPool
[hide private]
[frames] | no frames]

Class ThreadPool

source code

object --+
         |
        ThreadPool

A synchronized thread pool. The number of pre-created threads is not changeable.

Instance Methods [hide private]
 
__init__(self, nthread)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
eventloop(self, tdata)
Event loop for the pre-created threads.
source code
 
__call__(self, func, arglists) source code

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

Instance Variables [hide private]
  nthread
number of threads in the pool.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, nthread)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • nthread (int) - number of threads for the pool.
Overrides: object.__init__

__call__(self, func, arglists)
(Call operator)

source code 
Parameters:
  • func (callable) - a callable to be dispatched to the thread pool
  • arglists (list) - a list of arguments for the callable.