User-space signal-handled RCU with deferred threaded reclamation. More...
|Buffer type. |
|Lock type. |
|Back-off scheme. |
|Disposer thread type. |
|Thread-side RCU part. |
|Access lock class. |
|Access lock class. |
|virtual void||retire_ptr (retired_ptr &p)|
|template<typename ForwardIterator >|
|void||batch_retire (ForwardIterator itFirst, ForwardIterator itLast)|
|Retires the pointer chain [|
|template<typename Func >|
|void||batch_retire (Func e)|
|Retires the pointer chain until |
|Waits to finish a grace period and calls disposing thread. |
|size_t||capacity () const|
|Returns the threshold of internal buffer. |
|int||signal_no () const|
|Returns the signal number stated for RCU. |
|static signal_threaded *||instance ()|
|Returns singleton instance. |
|static bool||isUsed ()|
|Checks if the singleton is created and ready to use. |
|static void||Construct (size_t nBufferCapacity=256, int nSignal=SIGUSR1)|
|Creates singleton object and starts reclamation thread. More...|
|static void||Destruct (bool bDetachAll=false)|
|Destroys singleton object and terminates internal reclamation thread. |
|static bool const||c_bBuffered = true|
|This RCU buffers disposed elements. |
User-space signal-handled RCU with deferred threaded reclamation.
This implementation is similar to signal_buffered but separate thread is created for deleting the retired objects. Like
signal_buffered, the class contains an internal buffer where retired objects are accumulated. When the buffer becomes full, the RCU
synchronize function is called that waits until all reader/updater threads end up their read-side critical sections, i.e. until the RCU quiescent state will come. After that the "work ready" message is sent to reclamation thread. The reclamation thread frees the buffer. This synchronization cycle may be called in any thread that calls retire_ptr function.
There is a wrapper gc<signal_threaded> for
signal_threaded class that provides unified RCU interface. You should use this wrapper class instead
Buffer- buffer type with FIFO semantics. Default is
cds::container::VyukovMPSCCycleQueue. See signal_buffered for description of buffer's interface. The buffer contains the objects of epoch_retired_ptr type that contains additional
m_nEpochfield. This field specifies an epoch when the object has been placed into the buffer. The
signal_threadedobject has a global epoch counter that is incremented on each
synchronize()call. The epoch is used internally to prevent early deletion.
Lock- mutex type, default is
DisposerThread- the reclamation thread class. Default is cds::urcu::dispose_thread, see the description of this class for required interface.
Backoff- back-off schema, default is cds::backoff::Default
Creates singleton object and starts reclamation thread.
nBufferCapacity parameter defines RCU threshold.
nSignal parameter defines a signal number stated for RCU, default is
The method pushes
p pointer to internal buffer. When the buffer becomes full synchronize function is called to wait for the end of grace period and then a message is sent to the reclamation thread.