cds  2.3.2
cds::urcu::gc< 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::gc< general_instant< Lock, Backoff > >:

Public Types

typedef general_instant< 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 ()
 Creates URCU general_instant singleton.
 
 ~gc ()
 Destroys URCU general_instant singleton.
 

Static Public Member Functions

static void synchronize ()
 Waits to finish a grace period.
 
template<typename T >
static void retire_ptr (T *p, free_retired_ptr_func pFunc)
 Frees the pointer p invoking pFunc after end of grace period. More...
 
template<typename Disposer , typename T >
static void retire_ptr (T *p)
 Frees the pointer using Disposer after end of grace period. More...
 
static void retire_ptr (retired_ptr &p)
 Frees the pointer after the end of grace period. 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 bool is_locked ()
 Checks if the thread is inside read-side critical section (i.e. the lock is acquired) More...
 
static void force_dispose ()
 Forced GC cycle call. More...
 

Detailed Description

template<class Lock, class Backoff>
class cds::urcu::gc< general_instant< Lock, Backoff > >

User-space general-purpose RCU with immediate reclamation.

This is a wrapper around general_instant class.

Template arguments:

Member Function Documentation

◆ access_lock()

template<class Lock , class Backoff >
static void cds::urcu::gc< general_instant< 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 Lock , class Backoff >
static void cds::urcu::gc< general_instant< 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 Lock , class Backoff >
static void cds::urcu::gc< general_instant< Lock, Backoff > >::force_dispose ( )
inlinestatic

Forced GC cycle call.

This method does nothing and is introduced only for uniformity with other garbage collectors.

◆ is_locked()

template<class Lock , class Backoff >
static bool cds::urcu::gc< general_instant< 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 Lock , class Backoff >
template<typename T >
static void cds::urcu::gc< general_instant< Lock, Backoff > >::retire_ptr ( T *  p,
free_retired_ptr_func  pFunc 
)
inlinestatic

Frees the pointer p invoking pFunc after end of grace period.

The function calls synchronize to wait for end of grace period and then evaluates disposing expression pFunc( p )

◆ retire_ptr() [2/3]

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

Frees the pointer using Disposer after end of grace period.

The function calls synchronize to wait for end of grace period and then evaluates disposing expression Disposer()( p )

◆ retire_ptr() [3/3]

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

Frees the pointer after the end of grace period.

The function calls synchronize to wait for end of grace period and then evaluates disposing expression p.m_funcFree( p.m_p )


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

cds 2.3.2 Developed by Maxim Khizhinsky aka khizmax and other contributors 2007 - 2017
Autogenerated Sun Dec 31 2017 12:10:54 by Doxygen 1.8.13