mphelpers - MPHelpers - Parallel processing routines

class vdrp.mphelpers.MPPool(jobnum, num_proc)[source]

Pool of threads consuming tasks from a queue

add_task(func, *args, **kargs)[source]

Add a task to the queue

wait_completion()[source]

Wait for completion of all the tasks in the queue

class vdrp.mphelpers.MPWorker(name, tasks)[source]

Bases: multiprocessing.process.Process

Thread executing tasks from a given tasks queue

run()[source]

Method to be run in sub-process; can be overridden in sub-class

class vdrp.mphelpers.ThreadPool(num_threads)[source]

Pool of threads consuming tasks from a queue

add_task(func, *args, **kargs)[source]

Add a task to the queue

wait_completion()[source]

Wait for completion of all the tasks in the queue

class vdrp.mphelpers.ThreadShutDownException[source]
class vdrp.mphelpers.ThreadWorker(name, tasks)[source]

Bases: threading.Thread

Thread executing tasks from a given tasks queue

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

vdrp.mphelpers.mp_run(func, args, rargv, parser)[source]
vdrp.mphelpers.shutdownThread()[source]