| Home | Trees | Index | Help |
|
|---|
| Package nxlucene :: Module threadpool :: Class ThreadPool |
|
| Method Summary | |
|---|---|
Initialize the thread pool with numThreads workers. | |
Retrieve the next task from the task queue. | |
Return the number of threads in the pool. | |
Clear the task queue and terminate all pooled threads, optionally allowing the tasks and threads to finish. | |
Insert a task into the queue. | |
External method to set the current pool size. | |
| Method Details |
|---|
__init__(self,
numThreads)
Initialize the thread pool with numThreads workers.
|
getNextTask(self)Retrieve the next task from the task queue. For use only by ThreadPoolThread objects contained in the pool. |
getThreadCount(self)Return the number of threads in the pool. |
joinAll(self, waitForTasks=True, waitForThreads=True)Clear the task queue and terminate all pooled threads, optionally allowing the tasks and threads to finish. |
queueTask(self, task, args=None, taskCallback=None)Insert a task into the queue. task must be callable; args and taskCallback can be None. |
setThreadCount(self, newNumThreads)External method to set the current pool size. Acquires the resizing lock, then calls the internal version to do real work. |
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Fri Jun 30 16:38:47 2006 | http://epydoc.sf.net |