User-space general-purpose RCU with deferred (buffered) reclamation. More...
|RCU tag. |
|Buffer type. |
|Lock type. |
|Back-off type. |
|Thread-side RCU part. |
|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 |
|Wait to finish a grace period and then clear the buffer. |
|size_t||capacity () const|
|Returns internal buffer capacity. |
|static general_buffered *||instance ()|
|Returns singleton instance. |
|static bool||isUsed ()|
|Checks if the singleton is created and ready to use. |
|static void||Construct (size_t nBufferCapacity=256)|
|Creates singleton object. More...|
|static void||Destruct (bool bDetachAll=false)|
|Destroys singleton object. |
|static bool const||c_bBuffered = true|
|This RCU buffers disposed elements. |
User-space general-purpose RCU with deferred (buffered) reclamation.
This URCU implementation 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 buffer and all retired objects are freed. This synchronization cycle may be called in any thread that calls
Buffer contains items of epoch_retired_ptr type and it should support a queue interface with three function:
bool push( retired_ptr& p )- places the retired pointer
pinto queue. If the function returns
falseit means that the buffer is full and RCU synchronization cycle must be processed.
bool pop( retired_ptr& p )- pops queue's head item into
pparameter; if the queue is empty this function must return
size_t size()- returns queue's item count.
The buffer is considered as full if
false or the buffer size reaches the RCU threshold.
There is a wrapper gc<general_buffered> for
general_buffered class that provides unified RCU interface. You should use this wrapper class instead
Creates singleton object.
nBufferCapacity parameter defines RCU threshold.
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 to free all pointers from the buffer.