Package Bio :: Package MultiProc :: Module Scheduler :: Class Scheduler
[hide private]
[frames] | no frames]

Class Scheduler

source code

Schedules threads to be run. No prioritization. Nothing fancy.

Methods: add Add a thread to be run. num_left Return the number of threads left. num_running Return the number of threads currently running. run Main loop. Returns whether there's still threads left.

Instance Methods [hide private]
 
__init__(self, max_threads, start_fn=None, finish_fn=None)
Scheduler(max_threads[, start_fn][, finish_fn]) -> object
source code
boolean
run(S)
Execute the main loop.
source code
 
add(S, thread) source code
number of threads left to run
num_left(S) source code
number of threads currently running
num_running(S) source code
Method Details [hide private]

__init__(self, max_threads, start_fn=None, finish_fn=None)
(Constructor)

source code 

Scheduler(max_threads[, start_fn][, finish_fn]) -> object

max_threads is the maximum number of threads to run at a time. start_fn and finish_fn are optional callbacks that take a thread as an argument. They are called before and after each thread.

run(S)

source code 

Execute the main loop. Return a boolean indicating whether threads are still running.

Returns: boolean