Boost logo

Boost :

Subject: [boost] [lockfree review] rfc: naming and interface
From: Tim Blechmann (tim_at_[hidden])
Date: 2011-07-21 05:46:40

hi all,

i am starting a new thread, because i want to start a new discussion on one
aspect of boost.lockfree: the naming of the data structure and the interface

the current names of the data structures are fifo, stack and ringbuffer. during
the pre-review some people suggested to use different names, lifo instead of
stack or queue instead of fifo.
in general i think it is a good idea to use a consistent naming (probably fifo
should be renamed to queue), but how does the ringbuffer come in? it is a queue
as well, but with different characteristics (spsc and wait-free).

data structure configuration:
stack and fifo currently use 3 template arguments: T for the managed type,
freelist_t as a tag to select the underlying freelist and Alloc as the allocator
which is used for the internal nodes:

template<typename T,
         typename freelist_t = caching_freelist_t,
         typename Alloc = std::allocator<T> >
class fifo/stack;

however i have been thinking about replacing it with a boost.parameter
interface, something like:

template<typename T, ... Options>
class fifo/stack;

with the options:

  boost::lockfree::freelist_can_allocate<true/false> to disable memory
  allocation during enqueue/push

  boost::lockfree::allocator<> to specify the allocator

ringbuffer size:
the ringbuffer currently has the signature:

template<typename T, size_t max_size> class ringbuffer;

if max_size is 0, the size of the ringbuffer can be configured at run-time with
a constructor. this is not really the cleanest interface, but i would like to
provide an interface, which supports both compile-time and run-time setting of
the size.

i would apprechiate a discussion about these points during the review.

thanks, tim

Boost list run by bdawes at, gregod at, cpdaniel at, john at