BloombergLP::bdlmt

Namespace for multithreaded timer and event scheduling components.

Types

NameDescription
EventScheduler This class provides a thread-safe event scheduler that executes callbacks in a separate "dispatcher thread." start must be invoked to start dispatching the callbacks. stop pauses the dispatching of the callbacks without removing the pending events.
EventSchedulerEventHandle Objects of this type refer to events in the EventScheduler API. They are convertible to const Event* references and may be used in any method that expects them.
EventSchedulerRecurringEventHandle Objects of this type refer to recurring events in the EventScheduler API. They are convertible to const RecurringEvent* references and may be used in any method which expects these.
EventSchedulerTestTimeSource This class provides a means to change the clock that is used by a given event-scheduler to determine when events should be triggered. Constructing a EventSchedulerTestTimeSource alters the behavior of the supplied event-scheduler. After a test time-source is created, the underlying scheduler will run events according to a discrete timeline, whose successive values are determined by calls to advanceTime on the test time-source, and can be retrieved by calling now on that test time-source. Note that the "system-time" held by a test time-source does not correspond to the current system time. Test writers must use caution when scheduling absolute-time events so that they are scheduled relative to the test time-source's value for now.
EventSchedulerTestTimeSource_Data Component-private implementation of test time-source state.
FixedThreadPool This class implements a thread pool used for concurrently executing multiple user-defined functions ("jobs").
MultiQueueThreadPool This class implements a dynamic, configurable pool of queues, each of which is processed serially by a thread pool.
MultiQueueThreadPool_Queue This private class provides a thread-safe, lightweight job queue.
MultipriorityThreadPool This class implements a thread-enabled, integrally-prioritized thread-pool mechanism used for concurrently executing multiple user-defined "jobs" supplied as either conventional C-style functions taking an optional void * data argument, or as more flexible functor objects.
Signaler This class template provides a thread-safe signaler that executes connected slots when invoked via its call operator. t_PROT is a function signature and must have a return type of void. The callable objects assigned to the slots may have return types other than void, in which case their return values will be discarded.
SignalerConnection This class represents a connection between a signaler and a slot. It is a lightweight object that has the ability to query whether the signaler and slot are currently connected, and to disconnect the slot from the signaler. Note that, unless otherwise specified, it is safe to invoke any method of SignalerConnection from the context of its associated slot, or any other slot.
SignalerConnectionGuard This guard type has a SignalerConnection, through which it can manage a slot, and when it is destroyed or assigned to it will disconnect that slot. It also contains a boolean waitOnDisconnect attribute, which determines whether disconnect or disconnectAndWait is used to disconnect the slot. The waitOnDisconnect attribute is set in constructors from a SignalerConnection and propagated when move constructing or move assigning a guard to a different guard.
Signaler_ArgumentType For a function prototype t_PROT of up to 9 arguments, provide types ForwardingTypeN which is the most convenient way to forward the Nth argument. * as the type of argument N itself (in the case of some fundamental types) * as a const reference (if TypeN is large and either by value or by const reference), or * as a reference to a modifiable object, if that's how the argument was passed in the first place. Note that nothing is passed as an rvalue reference, since if there are multiple slots (usually the case), the argument will be moved from by the first one and then unsuitable to be used by the ones following.
Signaler_Invocable Provides a call operator for the derived class bdlmt::Signaler, such that its call signature is identical to that of t_PROT.
Signaler_Node Provides the implementation of a signaler. This object has a 1-1 relationship with the Signaler, which has a shared pointer to it. This allows other objects to refer to it via shared and weak pointers. This allows SignalerConnection objects to outlive the `Signaler - Signaler_Node` pair, since they can test or lock weak pointers to see if the Signaler_Node still exists when they are trying to disconnect themselves.
Signaler_NotArg Provides a "Not an Argument" tag type.
Signaler_SlotNode Dynamically-allocated container for one slot, containing a function object that can be called by a signaler. Owned by a shared pointer in a skip list container in the Signaler_Node. Also referred to by weak pointers from SignalerConnection objects.
Signaler_SlotNode_Base Provide a non-template protocol base class for Signaler_SlotNode so SignalerConnection objects, which are not templated, can refer to and manipulate Signaler_SlotNode objects.
ThreadMultiplexor This class provides a mechanism for facilitating the use of multiple threads to perform various user-defined functions ("jobs") when some degree of collaboration between threads is required. The thread multiplexor is configured with a total number of "processors", representing the number of threads that may process jobs at any particular time. Additional threads enqueue jobs to a pending job queue, which is processed by the next available processing thread.
ThreadPool This class implements a thread pool used for concurrently executing multiple user-defined functions ("jobs").
ThreadPoolWaitNode Component-private node for the LIFO wait list of idle worker threads.
Throttle This class provides a mechanism that can be used by clients to regulate the frequency at which actions can be taken. The data members of Throttle are currently public to allow for compile-time (aggregate) initialization of Throttle objects having static storage duration (for C++03 compilers that do not provide constexpr).
Throttle_InitHelper [PRIVATE]This component private meta-function is used to implement the initialization macros. This type provides the following: * Ensures arguments are evaluated at compile time (which won't be the case for floating point arguments) * Enables compile time checks with BSLMF_ASSERT * Handles special cases if 0 is passed for t_MAX_SIMULTANEOUS_ACTIONS or t_NANOSECONDS_PER_ACTION
TimerEventScheduler This class provides a thread-safe event scheduler. scheduleEvent schedules a non-recurring event, returning a handle of type TimerEventScheduler::Handle, which can be used to cancel the scheduled event by invoking cancelEvent. Similarly, startClock schedules a recurring event, returning a handle of type TimerEventScheduler::Handle, which can be used to cancel the clock by invoking cancelClock. cancelAllEvents cancels all the registered events and cancelAllClocks cancels all the registered clocks. The callbacks are processed by a separate thread (called dispatcher thread). By default the callbacks are executed in the dispatcher thread, but this behavior can be altered by providing a dispatcher functor at the creation time (see the section "The dispatcher thread and the dispatcher functor"). start must be invoked to start dispatching the callbacks. stop stops the dispatching of the callbacks without removing the pending events.
TimerEventSchedulerDispatcher Dispatcher functor type for TimerEventScheduler.
TimerEventSchedulerTestTimeSource This class provides a means to change the clock that is used by a given event-scheduler to determine when events should be triggered. Constructing a TimerEventSchedulerTestTimeSource alters the behavior of the supplied event-scheduler. After a test time-source is created, the underlying scheduler will run events according to a discrete timeline, whose successive values are determined by calls to advanceTime on the test time-source, and can be retrieved by calling now on that test time-source. Note that the "system-time" held by a test time-source does not correspond to the current system time. Test writers must use caution when scheduling absolute-time events so that they are scheduled relative to the test time-source's value for now.
TimerEventSchedulerTestTimeSource_Data Test time-source data for TimerEventScheduler (testing only).

Type Aliases

NameDescription
FixedThreadPoolJobFunc This type declares the prototype for functions that are suitable to be specified bdlmt::FixedThreadPool::enqueueJob.
ThreadPoolJobFunc This type declares the prototype for functions that are suitable to be specified bdlmt::FixedThreadPool::enqueueJob.

Functions

NameDescription
ThreadPoolEntry Entry point for processing threads.
swap Swap the contents of the specified a and b. Throws nothing.
operator== Return true if the specified lhs and rhs referring to the same slot and false otherwise.
operator!= Return false if the specified lhs and rhs referring to the same slot and true otherwise.
operator< Return true if the specified lhs is less than the specified rhs and false otherwise.
operator<= Return true if the specified lhs is less than or equal to the specified rhs and false otherwise.
operator> Return true if the specified lhs is grater than the specified rhs and false otherwise.
operator>= Return true if the specified lhs is greater than or equal to the specified rhs and false otherwise.