boost::parameter::template_keyword< tag::allocator, Alloc >

Defines the allocator type of a data structure.

size_t
boost::parameter::template_keyword< tag::capacity, boost::mpl::size_t< Size > >

Sets the capacity of a data structure at compile-time.

This implies that a data structure is bounded and fixed-sized.

bool
boost::parameter::template_keyword< tag::fixed_sized, boost::mpl::bool_< IsFixedSized > >

Configures a data structure as fixed-sized.

The internal nodes are stored inside an array and they are addressed by array indexing. This limits the possible size of the queue to the number of elements that can be addressed by the index type (usually 2**16-2), but on platforms that lack double-width compare-and-exchange instructions, this is the best way to achieve lock-freedom. This implies that a data structure is bounded.

typename ...

The queue class provides a multi-writer/multi-reader queue, pushing and popping is lock-free, construction/destruction has to be synchronized. It uses a freelist for memory management, freed nodes are pushed to the freelist and not returned to the OS before the queue is destroyed.

Policies:

- boost::lockfree::fixed_sized, defaults to `boost::lockfree::fixed_sized<false>` Can be used to completely disable dynamic memory allocations during push in order to ensure lockfree behavior. If the data structure is configured as fixed-sized, the internal nodes are stored inside an array and they are addressed by array indexing. This limits the possible size of the queue to the number of elements that can be addressed by the index type (usually 2**16-2), but on platforms that lack double-width compare-and-exchange instructions, this is the best way to achieve lock-freedom.

- boost::lockfree::capacity, optional If this template argument is passed to the options, the size of the queue is set at compile-time. This option implies `fixed_sized<true>`

- boost::lockfree::allocator, defaults to `boost::lockfree::allocator<std::allocator<void>>` Specifies the allocator that is used for the internal freelist

Requirements:

- T must have a copy constructor

- T must have a trivial assignment operator

- T must have a trivial destructor

T
implementation_defined::allocator
implementation_defined::size_type
bool `void`

It only checks, if the queue head and tail nodes and the freelist can be modified in a lock-free manner. On most platforms, the whole implementation is lock-free, if this is true. Using c++0x-style atomics, there is no possibility to provide a completely accurate implementation, because one would need to test every internal node, which is impossible if further nodes will be allocated from the operating system.

true, if implementation is lock-free.

void

Construct a fixed-sized queue

Must specify a capacity<> argument

typename boost::allocator_rebind< node_allocator, U >::type const &

Construct a fixed-sized queue with a custom allocator

Must specify a capacity<> argument

allocator const &

Construct a fixed-sized queue with a custom allocator

Must specify a capacity<> argument

size_type

Construct a variable-sized queue

Allocate n nodes initially for the freelist

Must not specify a capacity<> argument

size_type
typename boost::allocator_rebind< node_allocator, U >::type const &

Construct a variable-sized queue with a custom allocator

Allocate n nodes initially for the freelist

Must not specify a capacity<> argument

void `size_type`

Allocate n nodes for freelist

thread-safe, may block if memory allocator blocks

only valid if no capacity<> argument given

void `size_type`

Allocate n nodes for freelist

not thread-safe, may block if memory allocator blocks

only valid if no capacity<> argument given

void

Destroys queue, free all nodes from freelist.

bool `void`

Check if the queue is empty

The result is only accurate, if no other thread modifies the queue. Therefore it is rarely practical to use this value in program logic.

true, if the queue is empty, false otherwise

bool `T const &`

Pushes object t to the queue.

Thread-safe. If internal memory pool is exhausted and the memory pool is not fixed-sized, a new node will be allocated from the OS. This may not be lock-free.

object will be pushed to the queue, if internal node can be allocated

true, if the push operation is successful.

bool `T const &`

Pushes object t to the queue.

Thread-safe and non-blocking. If internal memory pool is exhausted, operation will fail

object will be pushed to the queue, if internal node can be allocated

true, if the push operation is successful.

`if` memory allocator throws

bool `T const &`

Pushes object t to the queue.

Not Thread-safe. If internal memory pool is exhausted and the memory pool is not fixed-sized, a new node will be allocated from the OS. This may not be lock-free.

object will be pushed to the queue, if internal node can be allocated

true, if the push operation is successful.

`if` memory allocator throws

bool `T &`

Pops object from queue.

Thread-safe and non-blocking

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if queue was empty.

bool `U &`

Pops object from queue.

Thread-safe and non-blocking

type U must be constructible by T and copyable, or T must be convertible to U

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if queue was empty.

bool `T &`

Pops object from queue.

Not thread-safe, but non-blocking

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if queue was empty.

bool `U &`

Pops object from queue.

Not thread-safe, but non-blocking

type U must be constructible by T and copyable, or T must be convertible to U

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if queue was empty.

bool `Functor &`

consumes one element via a functor

pops one element from the queue and applies the functor on this object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

true, if one element was consumed

bool `Functor const &`

consumes one element via a functor

pops one element from the queue and applies the functor on this object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

true, if one element was consumed

size_t `Functor &`

consumes all elements via a functor

sequentially pops all elements from the queue and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_t `Functor const &`

consumes all elements via a functor

sequentially pops all elements from the queue and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

typename ...

The spsc_queue class provides a single-writer/single-reader fifo queue, pushing and popping is wait-free.

Policies:

- `boost::lockfree::capacity<>`, optional If this template argument is passed to the options, the size of the ringbuffer is set at compile-time.

- `boost::lockfree::allocator<>`, defaults to `boost::lockfree::allocator<std::allocator<T>>` Specifies the allocator that is used to allocate the ringbuffer. This option is only valid, if the ringbuffer is configured to be sized at run-time

Requirements:

- T must have a default constructor

- T must be copyable

T
implementation_defined::allocator
implementation_defined::size_type
void

Constructs a spsc_queue

spsc_queue must be configured to be sized at compile-time

typename boost::allocator_rebind< allocator, U >::type const &

Constructs a spsc_queue with a custom allocator

This is just for API compatibility: an allocator isn't actually needed

spsc_queue must be configured to be sized at compile-time

allocator const &

Constructs a spsc_queue with a custom allocator

This is just for API compatibility: an allocator isn't actually needed

spsc_queue must be configured to be sized at compile-time

size_type

Constructs a spsc_queue for element_count elements

spsc_queue must be configured to be sized at run-time

size_type
typename boost::allocator_rebind< allocator, U >::type const &

Constructs a spsc_queue for element_count elements with a custom allocator

spsc_queue must be configured to be sized at run-time

size_type
allocator_arg const &

Constructs a spsc_queue for element_count elements with a custom allocator

spsc_queue must be configured to be sized at run-time

bool `T const &`

Pushes object t to the ringbuffer.

Thread-safe and wait-free

only one thread is allowed to push data to the spsc_queue

object will be pushed to the spsc_queue, unless it is full.

true, if the push operation is successful.

bool

Pops one object from ringbuffer.

Thread-safe and wait-free

only one thread is allowed to pop data to the spsc_queue

if ringbuffer is not empty, object will be discarded.

true, if the pop operation is successful, false if ringbuffer was empty.

boost::enable_if< typenameis_convertible< T, U >::type, bool >::type `U &`

Pops one object from ringbuffer.

Thread-safe and wait-free

only one thread is allowed to pop data to the spsc_queue

if ringbuffer is not empty, object will be copied to ret.

true, if the pop operation is successful, false if ringbuffer was empty.

size_type `T const *` `size_type`

Pushes as many objects from the array t as there is space.

Thread-safe and wait-free

only one thread is allowed to push data to the spsc_queue

number of pushed items

size_type size_type `T const (&)`

Pushes as many objects from the array t as there is space available.

Thread-safe and wait-free

only one thread is allowed to push data to the spsc_queue

number of pushed items

ConstIterator `ConstIterator` `ConstIterator`

Pushes as many objects from the range [begin, end) as there is space .

Thread-safe and wait-free

only one thread is allowed to push data to the spsc_queue

iterator to the first element, which has not been pushed

size_type `T *` `size_type`

Pops a maximum of size objects from ringbuffer.

Thread-safe and wait-free

only one thread is allowed to pop data to the spsc_queue

number of popped items

size_type size_type `T(&)`

Pops a maximum of size objects from spsc_queue.

Thread-safe and wait-free

only one thread is allowed to pop data to the spsc_queue

number of popped items

boost::disable_if< typenameis_convertible< T, OutputIterator >::type, size_type >::type `OutputIterator`

Pops objects to the output iterator it

Thread-safe and wait-free

only one thread is allowed to pop data to the spsc_queue

number of popped items

bool `Functor &`

consumes one element via a functor

pops one element from the queue and applies the functor on this object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

true, if one element was consumed

bool `Functor const &`

consumes one element via a functor

pops one element from the queue and applies the functor on this object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

true, if one element was consumed

size_type `Functor &`

consumes all elements via a functor

sequentially pops all elements from the queue and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_type `Functor const &`

consumes all elements via a functor

sequentially pops all elements from the queue and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_type

get number of elements that are available for read

Thread-safe and wait-free, should only be called from the consumer thread

number of available elements that can be popped from the spsc_queue

size_type

get write space to write elements

Thread-safe and wait-free, should only be called from the producer thread

number of elements that can be pushed to the spsc_queue

const T &

get reference to element in the front of the queue

Availability of front element can be checked using read_available().

Thread-safe and wait-free

only a consuming thread is allowed to check front element

read_available() > 0. If ringbuffer is empty, it's undefined behaviour to invoke this method.

reference to the first element in the queue

T &

get reference to element in the front of the queue

Availability of front element can be checked using read_available().

Thread-safe and wait-free

only a consuming thread is allowed to check front element

read_available() > 0. If ringbuffer is empty, it's undefined behaviour to invoke this method.

reference to the first element in the queue

void `void`

reset the ringbuffer

Not thread-safe

The stack class provides a multi-writer/multi-reader stack, pushing and popping is lock-free, construction/destruction has to be synchronized. It uses a freelist for memory management, freed nodes are pushed to the freelist and not returned to the OS before the stack is destroyed.

Policies:

- `boost::lockfree::fixed_sized<>`, defaults to `boost::lockfree::fixed_sized<false>` Can be used to completely disable dynamic memory allocations during push in order to ensure lockfree behavior. If the data structure is configured as fixed-sized, the internal nodes are stored inside an array and they are addressed by array indexing. This limits the possible size of the stack to the number of elements that can be addressed by the index type (usually 2**16-2), but on platforms that lack double-width compare-and-exchange instructions, this is the best way to achieve lock-freedom.

- `boost::lockfree::capacity<>`, optional If this template argument is passed to the options, the size of the stack is set at compile-time. It this option implies `fixed_sized<true>`

- `boost::lockfree::allocator<>`, defaults to `boost::lockfree::allocator<std::allocator<void>>` Specifies the allocator that is used for the internal freelist

Requirements:

- T must have a copy constructor

node_allocator
std::size_t
unspecified
handle_t
const T
T const &
boost::is_copy_constructible< T >::value
(mpl::if_c< has_capacity, mpl::bool_< `capacity` - 1< boost::integer_traits< boost::uint16_t >::const_max >, mpl::true_ >::type::value)
stack
(`stack` const &)
bool `void`

It only checks, if the top stack node and the freelist can be modified in a lock-free manner. On most platforms, the whole implementation is lock-free, if this is true. Using c++0x-style atomics, there is no possibility to provide a completely accurate implementation, because one would need to test every internal node, which is impossible if further nodes will be allocated from the operating system.

true, if implementation is lock-free.

void

Construct a fixed-sized stack

Must specify a capacity<> argument

typename boost::allocator_rebind< node_allocator, U >::type const &

Construct a fixed-sized stack with a custom allocator

Must specify a capacity<> argument

allocator const &

Construct a fixed-sized stack with a custom allocator

Must specify a capacity<> argument

size_type

Construct a variable-sized stack

Allocate n nodes initially for the freelist

Must not specify a capacity<> argument

size_type
typename boost::allocator_rebind< node_allocator, U >::type const &

Construct a variable-sized stack with a custom allocator

Allocate n nodes initially for the freelist

Must not specify a capacity<> argument

void `size_type`

Allocate n nodes for freelist

thread-safe, may block if memory allocator blocks

only valid if no capacity<> argument given

void `size_type`

Allocate n nodes for freelist

not thread-safe, may block if memory allocator blocks

only valid if no capacity<> argument given

void

Destroys stack, free all nodes from freelist.

not thread-safe

void `void`
void `node *` `node *`
void `node *` `node *`
tuple< node *, node * > bool bool `ConstIterator` `ConstIterator` `ConstIterator &`
bool bool `T const &`
ConstIterator bool `ConstIterator` `ConstIterator`
bool `T const &`

Pushes object t to the stack.

Thread-safe. If internal memory pool is exhausted and the memory pool is not fixed-sized, a new node will be allocated from the OS. This may not be lock-free.

object will be pushed to the stack, if internal node can be allocated

true, if the push operation is successful.

`if` memory allocator throws

bool `T const &`

Pushes object t to the stack.

Thread-safe and non-blocking. If internal memory pool is exhausted, the push operation will fail

object will be pushed to the stack, if internal node can be allocated

true, if the push operation is successful.

ConstIterator `ConstIterator` `ConstIterator`

Pushes as many objects from the range [begin, end) as freelist node can be allocated.

Operation is applied atomically

Thread-safe. If internal memory pool is exhausted and the memory pool is not fixed-sized, a new node will be allocated from the OS. This may not be lock-free.

iterator to the first element, which has not been pushed

`if` memory allocator throws

ConstIterator `ConstIterator` `ConstIterator`

Pushes as many objects from the range [begin, end) as freelist node can be allocated.

Operation is applied atomically

Thread-safe and non-blocking. If internal memory pool is exhausted, the push operation will fail

iterator to the first element, which has not been pushed

`if` memory allocator throws

bool `T const &`

Pushes object t to the stack.

Not thread-safe. If internal memory pool is exhausted and the memory pool is not fixed-sized, a new node will be allocated from the OS. This may not be lock-free.

object will be pushed to the stack, if internal node can be allocated

true, if the push operation is successful.

`if` memory allocator throws

ConstIterator `ConstIterator` `ConstIterator`

Pushes as many objects from the range [begin, end) as freelist node can be allocated.

Not thread-safe. If internal memory pool is exhausted and the memory pool is not fixed-sized, a new node will be allocated from the OS. This may not be lock-free.

iterator to the first element, which has not been pushed

`if` memory allocator throws

bool `T &`

Pops object from stack.

Thread-safe and non-blocking

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if stack was empty.

bool `U &`

Pops object from stack.

Thread-safe and non-blocking

type T must be convertible to U

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if stack was empty.

bool `T &`

Pops object from stack.

Not thread-safe, but non-blocking

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if stack was empty.

bool `U &`

Pops object from stack.

Not thread-safe, but non-blocking

type T must be convertible to U

if pop operation is successful, object will be copied to ret.

true, if the pop operation is successful, false if stack was empty.

bool `Functor &`

consumes one element via a functor

pops one element from the stack and applies the functor on this object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

true, if one element was consumed

bool `Functor const &`

consumes one element via a functor

pops one element from the stack and applies the functor on this object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

true, if one element was consumed

size_t `Functor &`

consumes all elements via a functor

sequentially pops all elements from the stack and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_t `Functor const &`

consumes all elements via a functor

sequentially pops all elements from the stack and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_t `Functor &`

consumes all elements via a functor

atomically pops all elements from the stack and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_t `Functor const &`

consumes all elements via a functor

atomically pops all elements from the stack and applies the functor on each object

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_t `Functor &`

consumes all elements via a functor

atomically pops all elements from the stack and applies the functor on each object in reversed order

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

size_t `Functor const &`

consumes all elements via a functor

atomically pops all elements from the stack and applies the functor on each object in reversed order

Thread-safe and non-blocking, if functor is thread-safe and non-blocking

number of elements that are consumed

bool `void`

It only guarantees that at some point during the execution of the function the stack has been empty. It is rarely practical to use this value in program logic, because the stack can be modified by other threads.

true, if stack is empty.