library of assembled shared sources

http://lass.cocamware.com

lass::stde::lock_free_queue< T, FixedAllocator > Class Template Reference

Non-blocking, lock-free FIFO data structure. More...

#include <lock_free_queue.h>

Inheritance diagram for lass::stde::lock_free_queue< T, FixedAllocator >:

Inheritance graph
[legend]
Collaboration diagram for lass::stde::lock_free_queue< T, FixedAllocator >:

Collaboration graph
[legend]

Data Structures

struct  node_t

Public Types

typedef T value_type

Public Member Functions

 lock_free_queue ()
 ~lock_free_queue ()
void push (const value_type &x)
 push a value in the back
bool pop (value_type &x)
 Try to pop a value from the front and store it in x.

Private Types

typedef util::TaggedPtr< node_tpointer_t
typedef util::AllocatorThrow
< util::AllocatorConcurrentFreeList
< FixedAllocator > > 
allocator_t

Private Member Functions

 lock_free_queue (const lock_free_queue &)
lock_free_queueoperator= (const lock_free_queue &)
value_type *const make_value (const value_type &x)
void free_value (value_type *value)
node_t *const make_node (value_type *x)
void free_node (node_t *node)

Private Attributes

volatile pointer_t head_
volatile pointer_t tail_
allocator_t node_allocator_
allocator_t value_allocator_

Detailed Description

template<typename T, typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
class lass::stde::lock_free_queue< T, FixedAllocator >

Non-blocking, lock-free FIFO data structure.

M. M. Michael, M. L. Scott, "Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms", Proc. of the 15th Annual ACM Symposium on Principles of Distributed Computing (PODC' 96), New York, USA, pp. 267-275 (1996).

Definition at line 67 of file lock_free_queue.h.


Member Typedef Documentation

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
typedef T lass::stde::lock_free_queue< T, FixedAllocator >::value_type

Definition at line 71 of file lock_free_queue.h.

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
typedef util::TaggedPtr<node_t> lass::stde::lock_free_queue< T, FixedAllocator >::pointer_t [private]

Definition at line 80 of file lock_free_queue.h.

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
typedef util::AllocatorThrow< util::AllocatorConcurrentFreeList<FixedAllocator> > lass::stde::lock_free_queue< T, FixedAllocator >::allocator_t [private]

Definition at line 89 of file lock_free_queue.h.


Constructor & Destructor Documentation

template<typename T , typename A >
lass::stde::lock_free_queue< T, A >::lock_free_queue (  )  [inline]

template<typename T , typename A >
lass::stde::lock_free_queue< T, A >::~lock_free_queue (  )  [inline]

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
lass::stde::lock_free_queue< T, FixedAllocator >::lock_free_queue ( const lock_free_queue< T, FixedAllocator > &   )  [private]


Member Function Documentation

template<typename T , typename A >
void lass::stde::lock_free_queue< T, A >::push ( const value_type x  )  [inline]

template<typename T , typename A >
bool lass::stde::lock_free_queue< T, A >::pop ( value_type x  )  [inline]

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
lock_free_queue& lass::stde::lock_free_queue< T, FixedAllocator >::operator= ( const lock_free_queue< T, FixedAllocator > &   )  [private]

template<typename T , typename A >
lock_free_queue< T, A >::value_type *const lass::stde::lock_free_queue< T, A >::make_value ( const value_type x  )  [inline, private]

template<typename T , typename A >
void lass::stde::lock_free_queue< T, A >::free_value ( value_type value  )  [inline, private]

template<typename T , typename A >
lock_free_queue< T, A >::node_t *const lass::stde::lock_free_queue< T, A >::make_node ( value_type x  )  [inline, private]

template<typename T , typename A >
void lass::stde::lock_free_queue< T, A >::free_node ( node_t node  )  [inline, private]


Field Documentation

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
volatile pointer_t lass::stde::lock_free_queue< T, FixedAllocator >::head_ [private]

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
volatile pointer_t lass::stde::lock_free_queue< T, FixedAllocator >::tail_ [private]

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
allocator_t lass::stde::lock_free_queue< T, FixedAllocator >::node_allocator_ [private]

template<typename T , typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
allocator_t lass::stde::lock_free_queue< T, FixedAllocator >::value_allocator_ [private]


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

Generated on Mon Nov 10 14:22:16 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo