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

Class Parallel

source code

This class is used to execute tasks in parallel, and is somewhat 
less efficient than Serial, but is appropriate for parallel builds.

This class is thread safe.



Instance Methods [hide private]
 
__init__(self, taskmaster, num, stack_size)
Create a new parallel job given a taskmaster.
source code
 
start(self)
Start the job.
source code
Method Details [hide private]

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

source code 
Create a new parallel job given a taskmaster.

The taskmaster's next_task() method should return the next
task that needs to be executed, or None if there are no more
tasks. The taskmaster's executed() method will be called
for each task when it is successfully executed or failed()
will be called if the task failed to execute (i.e. execute()
raised an exception).

Note: calls to taskmaster are serialized, but calls to
execute() on distinct tasks are not serialized, because
that is the whole point of parallel jobs: they can execute
multiple tasks simultaneously. 

start(self)

source code 
Start the job. This will begin pulling tasks from the
taskmaster and executing them, and return when there are no
more tasks. If a task fails to execute (i.e. execute() raises
an exception), then the job will stop.