cds  2.3.1
cds::urcu::general_instant< Lock, Backoff > Class Template Reference

User-space general-purpose RCU with immediate reclamation. More...

#include <cds/urcu/general_instant.h>

Inheritance diagram for cds::urcu::general_instant< Lock, Backoff >:

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_instantinstance ()
 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.

Detailed Description

template<class Lock = std::mutex, class Backoff = cds::backoff::Default>
class cds::urcu::general_instant< Lock, Backoff >

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:

Member Function Documentation

◆ retire_ptr()

template<class Lock = std::mutex, class Backoff = cds::backoff::Default>
virtual void cds::urcu::general_instant< Lock, Backoff >::retire_ptr ( retired_ptr p)

Retires p pointer.

The method calls synchronize() to wait for the end of grace period and calls p disposer.

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

cds 2.3.1 Developed by Maxim Khizhinsky aka khizmax 2007 - 2017
Autogenerated Fri Sep 1 2017 08:47:42 by Doxygen 1.8.13