|
cds
2.3.2
|
User-space general-purpose RCU with immediate reclamation. More...
#include <cds/urcu/general_instant.h>
Public Types | |
| typedef general_instant_tag | rcu_tag |
| RCU tag. | |
| typedef Lock | lock_type |
| Lock type. | |
| typedef Backoff | back_off |
| Back-off schema type. | |
| typedef base_class::thread_gc | thread_gc |
| Thread-side RCU part. | |
| typedef thread_gc::scoped_lock | scoped_lock |
| Access lock class. | |
Public Member Functions | |
| virtual void | retire_ptr (retired_ptr &p) override |
Retires p pointer. More... | |
| template<typename ForwardIterator > | |
| void | batch_retire (ForwardIterator itFirst, ForwardIterator itLast) |
Retires the pointer chain [itFirst, itLast) | |
| template<typename Func > | |
| void | batch_retire (Func e) |
Retires the pointer chain until Func returns nullptr retired pointer. | |
| void | synchronize () |
| Waits to finish a grace period. | |
Static Public Member Functions | |
| static general_instant * | instance () |
| Returns singleton instance. | |
| static bool | isUsed () |
| Checks if the singleton is created and ready to use. | |
| static void | Construct () |
| Creates singleton object. | |
| static void | Destruct (bool bDetachAll=false) |
| Destroys singleton object. | |
User-space general-purpose RCU with immediate reclamation.
This is simplest general-purpose RCU implementation. When a thread calls retire_ptr function 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 retired object is freed immediately. Thus, the implementation blocks for any retired object
There is a wrapper gc<general_instant> for general_instant class that provides unified RCU interface. You should use this wrapper class instead general_instant
Template arguments:
Lock - mutex type, default is std::mutex Backoff - back-off schema, default is cds::backoff::Default
|
inlineoverridevirtual |
Retires p pointer.
The method calls synchronize() to wait for the end of grace period and calls p disposer.