Module: vemomoto_core.concurrent.nicepar#

Created on 27.04.2016

@author: Samuel

Classes:

CircularParallelCounter([size, lock])

Counter([size, interval])

DummyObj(parent)

DummyVar(value)

Lockable([lock])

Locked(parent)

Context manager ensuring that no dirty read/write occurs.

ParallelClass([num_workers, ...])

Class to simplify the implementation of objects whose methods can be executed in parallel.

ParallelCounter([size, interval, lock, manager])

SharableListArr(arr, dtype)

Functions:

getCounter([size, interval])

class CircularParallelCounter(size=1, lock=None)[source]#

Bases: vemomoto_core.concurrent.nicepar.Lockable

Methods:

next()

reset()

next()[source]#
reset()[source]#
class Counter(size=1, interval=None)[source]#

Bases: object

Methods:

next()

reset()

next()[source]#
reset()[source]#
class DummyObj(parent)[source]#

Bases: object

Methods:

update()

update()[source]#
class DummyVar(value)[source]#

Bases: object

class Lockable(lock=None)[source]#

Bases: object

class Locked(parent)[source]#

Bases: object

Context manager ensuring that no dirty read/write occurs. Use with the “with” statement:

with Locked(self):

# do something that requires the object to be # accassible to this process only pass

class ParallelClass(num_workers=None, make_sharable_functions=[], exclude=[], prohibit_sharing=False)[source]#

Bases: vemomoto_core.concurrent.nicepar.Lockable

Class to simplify the implementation of objects whose methods can be executed in parallel.

Methods:

parmap(f, argList)

Executes f(arg) for arg in argList in parallel returns a list of the results in the same order as the arguments, invalid results (None) are ignored

postpone_task(f, *args)

parmap(f, argList)[source]#

Executes f(arg) for arg in argList in parallel returns a list of the results in the same order as the arguments, invalid results (None) are ignored

postpone_task(f, *args)[source]#
class ParallelCounter(size=1, interval=None, lock=None, manager=None)[source]#

Bases: vemomoto_core.concurrent.nicepar.Lockable

Methods:

next()

reset()

next()[source]#
reset()[source]#
class SharableListArr(arr, dtype)[source]#

Bases: object

getCounter(size=1, interval=None)[source]#