cds  2.2.0
cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > > Class Template Reference

User-space signal-handled RCU with deferred buffered reclamation. More...

#include <cds/urcu/signal_buffered.h>

Inheritance diagram for cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >:

Public Types

typedef signal_buffered< Buffer, Lock, Backoff > rcu_implementation
 Wrapped URCU implementation.
 
typedef rcu_implementation::rcu_tag rcu_tag
 URCU tag.
 
typedef rcu_implementation::thread_gc thread_gc
 Thread-side RCU part.
 
typedef rcu_implementation::scoped_lock scoped_lock
 Access lock class.
 

Public Member Functions

 gc (size_t nBufferCapacity=256, int nSignal=SIGUSR1)
 Creates URCU signal_buffered singleton. More...
 
 ~gc ()
 Destroys URCU general_instant singleton.
 

Static Public Member Functions

static void synchronize ()
 Waits to finish a grace period and clears the buffer. More...
 
template<typename T >
static void retire_ptr (T *p, void(*pFunc)(T *))
 Places retired pointer <p, pFunc> to internal buffer. More...
 
template<typename Disposer , typename T >
static void retire_ptr (T *p)
 Places retired pointer p with Disposer to internal buffer. More...
 
static void retire_ptr (retired_ptr &p)
 Places retired pointer p to internal buffer. More...
 
template<typename ForwardIterator >
static void batch_retire (ForwardIterator itFirst, ForwardIterator itLast)
 Frees chain [ itFirst, itLast) in one synchronization cycle.
 
template<typename Func >
static void batch_retire (Func e)
 Retires the pointer chain until Func returns nullptr retired pointer.
 
static void access_lock ()
 Acquires access lock (so called RCU reader-side lock) More...
 
static void access_unlock ()
 Releases access lock (so called RCU reader-side lock) More...
 
static size_t capacity ()
 Returns the threshold of internal buffer.
 
static int signal_no ()
 Returns the signal number stated for RCU.
 
static bool is_locked ()
 Checks if the thread is inside read-side critical section (i.e. the lock is acquired) More...
 
static void force_dispose ()
 Forces retired object removal. More...
 

Detailed Description

template<class Buffer, class Lock, class Backoff>
class cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >

User-space signal-handled RCU with deferred buffered reclamation.

This is a wrapper around signal_buffered class.

Template arguments:

  • Buffer - lock-free queue or lock-free bounded queue. Default is cds::container::VyukovMPMCCycleQueue< retired_ptr >
  • Lock - mutex type, default is std::mutex
  • Backoff - back-off schema, default is cds::backoff::Default

Constructor & Destructor Documentation

§ gc()

template<class Buffer , class Lock , class Backoff >
cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::gc ( size_t  nBufferCapacity = 256,
int  nSignal = SIGUSR1 
)
inline

Creates URCU signal_buffered singleton.

The nBufferCapacity parameter defines RCU threshold.

The nSignal parameter defines a signal number stated for RCU, default is SIGUSR1

Member Function Documentation

§ access_lock()

template<class Buffer , class Lock , class Backoff >
static void cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::access_lock ( )
inlinestatic

Acquires access lock (so called RCU reader-side lock)

For safety reasons, it is better to use scoped_lock class for locking/unlocking

§ access_unlock()

template<class Buffer , class Lock , class Backoff >
static void cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::access_unlock ( )
inlinestatic

Releases access lock (so called RCU reader-side lock)

For safety reasons, it is better to use scoped_lock class for locking/unlocking

§ force_dispose()

template<class Buffer , class Lock , class Backoff >
static void cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::force_dispose ( )
inlinestatic

Forces retired object removal.

This function calls synchronize

§ is_locked()

template<class Buffer , class Lock , class Backoff >
static bool cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::is_locked ( )
inlinestatic

Checks if the thread is inside read-side critical section (i.e. the lock is acquired)

Usually, this function is used internally to be convinced that subsequent remove action is not lead to a deadlock.

§ retire_ptr() [1/3]

template<class Buffer , class Lock , class Backoff >
template<typename T >
static void cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::retire_ptr ( T *  p,
void(*)(T *)  pFunc 
)
inlinestatic

Places retired pointer <p, pFunc> to internal buffer.

If the buffer is full, synchronize function is invoked.

§ retire_ptr() [2/3]

template<class Buffer , class Lock , class Backoff >
template<typename Disposer , typename T >
static void cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::retire_ptr ( T *  p)
inlinestatic

Places retired pointer p with Disposer to internal buffer.

If the buffer is full, synchronize function is invoked.

§ retire_ptr() [3/3]

template<class Buffer , class Lock , class Backoff >
static void cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::retire_ptr ( retired_ptr p)
inlinestatic

Places retired pointer p to internal buffer.

If the buffer is full, synchronize function is invoked.

§ synchronize()

template<class Buffer , class Lock , class Backoff >
static void cds::urcu::gc< signal_buffered< Buffer, Lock, Backoff > >::synchronize ( )
inlinestatic

Waits to finish a grace period and clears the buffer.

After grace period finished the function frees all retired pointer from internal buffer.


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

cds 2.2.0 Developed by Maxim Khizhinsky aka khizmax 2007 - 2017
Autogenerated Wed Jan 4 2017 08:50:07 by Doxygen 1.8.12