dragon.mpbridge.synchronize
Dragon’s replacements for the synchronization primitives in Multiprocessing.
Except for Condition
, all components are based on dragon.native
component
and are implemented over one or more dragon channels. Lock
is patched with a
dummy _SemLock
class, so Condition
works out of the box.
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
Classes
Augment the Dragon Native Lock so it can be used by Python Multiprocessing |
|
|
|
|
|
|
|
|
|
|
|
|
|
Dragons replacement for the Multiprocessing Condition removes all references to _semlock and the test for assert_spawning. |
|
- class AugmentedDragonNativeLock
Augment the Dragon Native Lock so it can be used by Python Multiprocessing
- class DragonLock
- class DragonRLock
- class DragonCondition
Dragons replacement for the Multiprocessing Condition removes all references to _semlock and the test for assert_spawning. The _semlock interface is mapped onto Dragon’s native Lock implementation.
- class DragonSemaphore
- __init__(*args, ctx, **kwargs)
Create a Semaphore object that can be shared across Dragon processes.
- class DragonBoundedSemaphore
- __init__(*args, ctx, **kwargs)
Create a Semaphore object that can be shared across Dragon processes.
- class DragonEvent
- __init__(*args, ctx, **kwargs)
Initialize an event object :param m_uid: memory pool to create the channel in, defaults to _DEF_MUID :type m_uid: int, optional
- class DragonBarrier
- __init__(parties: int, action: Optional[callable] = None, timeout: Optional[float] = None, *, ctx=None)
Initialize a barrier object :param parties: number of parties for the barrier to act upon :type parties: int, optional, > 2 :param action: class that the barrier calls upon :type callable: optional :param timeout: timeout for barrier :type timeout: float, optional :param m_uid: memory pool to create the channel in, defaults to _DEF_MUID :type m_uid: int, optional
- class BaseImplBarrier
- __init__(*args, **kwargs)
Create a barrier, initialised to ‘parties’ threads.
‘action’ is a callable which, when supplied, will be called by one of the threads after they have all entered the barrier and just prior to releasing them all. If a ‘timeout’ is provided, it is used as the default for all subsequent ‘wait()’ calls.