![]() |
fpmas 1.6
|
#include <hard_sync_mode.h>
Public Member Functions | |
virtual void | pushRequest (MutexRequest request)=0 |
virtual std::queue< MutexRequest > | requestsToProcess ()=0 |
![]() | |
virtual T & | data ()=0 |
virtual const T & | data () const =0 |
virtual const T & | read ()=0 |
virtual void | releaseRead ()=0 |
virtual T & | acquire ()=0 |
virtual void | releaseAcquire ()=0 |
virtual void | lock ()=0 |
virtual void | unlock ()=0 |
virtual bool | locked () const =0 |
virtual void | lockShared ()=0 |
virtual void | unlockShared ()=0 |
virtual int | sharedLockCount () const =0 |
virtual void | synchronize ()=0 |
Additional Inherited Members | |
![]() | |
virtual void | _lock ()=0 |
virtual void | _lockShared ()=0 |
virtual void | _unlock ()=0 |
virtual void | _unlockShared ()=0 |
Mutex API extension to handle HardSyncMode.
This API adds a request queue concept to the regular Mutex. Each HardSyncMutex instance (and so each DistributedNode) is associated to a queue of lock, shared lock, read and acquire requests incoming from available processes, including the local process. It is the job of the MutexServer to enqueue and handle those requests.
|
pure virtual |
Pushes a pending request into the waiting queue.
request | mutex request to push |
Implemented in fpmas::synchro::hard::HardSyncMutex< T >.
|
pure virtual |
Returns an ordered list of requests that can be handled, depending on the current mutex status.
For example, if the mutex is locked, an empty queue might be returned. Else, read or lock shared requests can be returned, until the next pending acquire or lock request.
In any case, the exact behavior is implementation defined and might depend about what priority is given to each request. (e.g. : https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem)
Implemented in fpmas::synchro::hard::HardSyncMutex< T >.