fpmas 1.6
Public Member Functions | List of all members
fpmas::synchro::hard::api::HardSyncMutex< T > Class Template Referenceabstract

#include <hard_sync_mode.h>

Inheritance diagram for fpmas::synchro::hard::api::HardSyncMutex< T >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::synchro::hard::api::HardSyncMutex< T >:
Collaboration graph
[legend]

Public Member Functions

virtual void pushRequest (MutexRequest request)=0
 
virtual std::queue< MutexRequestrequestsToProcess ()=0
 
- Public Member Functions inherited from fpmas::api::synchro::Mutex< T >
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

- Protected Member Functions inherited from fpmas::api::synchro::Mutex< T >
virtual void _lock ()=0
 
virtual void _lockShared ()=0
 
virtual void _unlock ()=0
 
virtual void _unlockShared ()=0
 

Detailed Description

template<typename T>
class fpmas::synchro::hard::api::HardSyncMutex< T >

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.

Member Function Documentation

◆ pushRequest()

template<typename T >
virtual void fpmas::synchro::hard::api::HardSyncMutex< T >::pushRequest ( MutexRequest  request)
pure virtual

Pushes a pending request into the waiting queue.

Parameters
requestmutex request to push

Implemented in fpmas::synchro::hard::HardSyncMutex< T >.

◆ requestsToProcess()

template<typename T >
virtual std::queue< MutexRequest > fpmas::synchro::hard::api::HardSyncMutex< T >::requestsToProcess ( )
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)

Returns
an ordered queue of request that can safely be handled at the time of the call, depending on the current mutex status

Implemented in fpmas::synchro::hard::HardSyncMutex< T >.


The documentation for this class was generated from the following files: