Quick Links: |
Provide containers that support concurrent (multi-thread) access. More...
Components | |
Component bdlcc_boundedqueue | |
Provide a thread-aware bounded queue of values. | |
Component bdlcc_cache | |
Provide a in-process cache with configurable eviction policy. | |
Component bdlcc_deque | |
Provide a fully thread-safe deque container. | |
Component bdlcc_fixedqueue | |
Provide a thread-aware fixed-size queue of values. | |
Component bdlcc_fixedqueueindexmanager | |
Provide thread-enabled state management for a fixed-size queue. | |
Component bdlcc_multipriorityqueue | |
Provide a thread-enabled parameterized multi-priority queue. | |
Component bdlcc_objectcatalog | |
Provide an efficient indexed, thread-safe object container. | |
Component bdlcc_objectpool | |
Provide a thread-safe object pool. | |
Component bdlcc_queue: DEPRECATED | |
Provide a thread-enabled queue of items of parameterized | |
Component bdlcc_sharedobjectpool | |
Provide a thread-safe pool of shared objects. | |
Component bdlcc_singleconsumerqueue | |
Provide a thread-aware single consumer queue of values. | |
Component bdlcc_singleconsumerqueueimpl | |
Provide a testable thread-aware single consumer queue of values. | |
Component bdlcc_singleproducerqueue | |
Provide a thread-aware single producer queue of values. | |
Component bdlcc_singleproducerqueueimpl | |
Provide a testable thread-aware single producer queue of values. | |
Component bdlcc_singleproducersingleconsumerboundedqueue | |
Provide a thread-aware SPSC bounded queue of values. | |
Component bdlcc_skiplist | |
Provide a generic thread-safe Skip List. | |
Component bdlcc_stripedunorderedcontainerimpl | |
Provide common implementation of striped un-ordered map/multimap. | |
Component bdlcc_stripedunorderedmap | |
Provide a bucket-group locking (i.e., striped) unordered map. | |
Component bdlcc_stripedunorderedmultimap | |
Provide a bucket-group locking (striped) unordered multimap. | |
Component bdlcc_timequeue | |
Provide an efficient queue for time events. |
bdlcc
package provides a set of containers that allow concurrent access and manipulation. Components in this package are similar in intent to the corresponding bdlc
components, except that all operations which change the internal state of the containers are guaranteed to be atomic in the presence of multiple threads. bdlc
components. A thread-safe collection cannot, in general, guarantee thread safety for its contained objects while still allowing access to those objects. So, for instance, a canonical implementation of operator[]
, yielding a reference to the contained object, would violate thread safety. Therefore, thread-safe collections will, in general, return items by value rather than by reference. bdlcc_Queue<T>popFront()
will block and then wait until an element is available to satisfy the request. bdlcc
support this blocking behavior where it makes sense. Refer to the individual component documentation to understand how this general principle is carried out in specific components. bdlcc
package is undefined unless all access or modification of the object is completed prior to its destruction. Some form of synchronization, external to the component, is required to ensure this precondition on the destructor is met. For example, if two (or more) threads are manipulating a container, it is not safe to anticipate the number of elements added to the container, and destroy that container immediately after the last element is removed (without additional synchronization) because one of the corresponding insert functions may not have completed (the insert may, for instance, signal waiting threads after the element is considered added to the container). bdlcc
package currently has 20 components having 4 levels of physical dependency. The list below shows the hierarchical ordering of the components. The order of components within each level is not architecturally significant, just alphabetical. 4. bdlcc_sharedobjectpool 3. bdlcc_objectpool 2. bdlcc_fixedqueue bdlcc_singleconsumerqueue bdlcc_singleproducerqueue bdlcc_stripedunorderedmap bdlcc_stripedunorderedmultimap 1. bdlcc_boundedqueue bdlcc_cache bdlcc_deque bdlcc_fixedqueueindexmanager bdlcc_multipriorityqueue bdlcc_objectcatalog bdlcc_queue !DEPRECATED! bdlcc_singleconsumerqueueimpl bdlcc_singleproducerqueueimpl bdlcc_singleproducersingleconsumerboundedqueue bdlcc_skiplist bdlcc_stripedunorderedcontainerimpl bdlcc_timequeue
bdlcc_boundedqueue
: bdlcc_cache
: bdlcc_deque
: bdlcc_fixedqueue
: bdlcc_fixedqueueindexmanager
: bdlcc_multipriorityqueue
: bdlcc_objectcatalog
: bdlcc_objectpool
: bdlcc_queue
: DEPRECATED TYPE
.bdlcc_sharedobjectpool
: bdlcc_singleconsumerqueue
: bdlcc_singleconsumerqueueimpl
: bdlcc_singleproducerqueue
: bdlcc_singleproducerqueueimpl
: bdlcc_singleproducersingleconsumerboundedqueue
: bdlcc_skiplist
: bdlcc_stripedunorderedcontainerimpl
: bdlcc_stripedunorderedmap
: bdlcc_stripedunorderedmultimap
: bdlcc_timequeue
: bdlcc
package. Full details are available in the documentation of each component. bdlcc_objectcatalog
component provides a thread-safe, indexable catalog of object. Clients instantiate a template class, bdlcc_ObjectCatalog<T>
, where type T
is the data type of elements that the catalog will hold. Type T
must be defined to be copyable either by a copy constructor or by T::operator=()
; class bdlcc_ObjectCatalog
places no additional requirements on T
. bdlcc_ObjectCatalog
, the add
method returns a handle which can be used to refer to the element until the element is remove
d. Addition is not guaranteed to succeed and the return vaslue must be checked. An element can be accessed through its handle by using the find
function and passing a buffer for holding the value. Passing a null buffer can be used for testing whether the handle is still valid (i.e., refers to an element that has not yet been removed from the catalog). bdlcc_ObjectCatalog
is designed to support direct access to individual queued elements based upon their Handle
. This means that bdlcc_Catalog
can support frequent additions and removals more efficiently than traditional queue structures designed for sequential access. bdlcc_pool
component provides a thread-safe memory pool of objects from a parameterized type T
. Clients instantiate a bdlcc_ObjectPool<T>
where the type T
has no requirements. The pool owns the memory and objects it contains. An object pool manages creation of its objects via a user-installed functor (given to the pool constructor), and provides automatic destruction of its objects either upon the destroyObject
method, or upon the pool destruction. An object can be obtained from the pool by calling the getObject
method, and can be released back to the pool for further use within getObject
by calling the releaseObject
method. bdlcc_queue
component provides an in-place, indexable, double-ended queue. Clients instantiate a template class, bdlcc_Queue<T>
, where type T
is the data type of elements that the queue will hold. Type T
must be defined to be copyable either by a copy constructor or by T::operator=()
; class bdlcc_Queue
Places no additional requirements on T
. bdlcc_timequeue
component provides an in-place, indexable queue, managed in time order. Clients instantiate a template class, bdlcc_TimeQueue<T>
, where type T
is the data type of elements that the queue will hold. Type T
must be defined to be copyable either by a copy constructor or by T::operator=()
; class bdlcc_TimeQueue
places no additional requirements on T
. bdlcc_TimeQueue
, they provide both the element T
to be added and a time value, of type bsls::TimeInterval
. Elements can be extracted individually in time order using the overloaded popFront()
member functions; a block of elements can also be popped in a single operation, popLE()
, which pops all elements before a given time value. bdlcc_TimeQueue
class template supports direct access to individual queued elements based upon their Handle
. This means that bdlcc_TimeQueue
can support frequent additions and removals more efficiently than traditional queue structures designed for sequential access.