[#BloombergLP-bdlmt] = xref:BloombergLP.adoc[BloombergLP]::bdlmt :relfileprefix: ../ :mrdocs: Namespace for multithreaded timer and event scheduling components. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlmt/EventScheduler.adoc[`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. | xref:BloombergLP/bdlmt/EventSchedulerEventHandle.adoc[`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. | xref:BloombergLP/bdlmt/EventSchedulerRecurringEventHandle.adoc[`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. | xref:BloombergLP/bdlmt/EventSchedulerTestTimeSource.adoc[`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`. | xref:BloombergLP/bdlmt/EventSchedulerTestTimeSource_Data.adoc[`EventSchedulerTestTimeSource_Data`] | Component‐private implementation of test time‐source state. | xref:BloombergLP/bdlmt/FixedThreadPool.adoc[`FixedThreadPool`] | This class implements a thread pool used for concurrently executing multiple user‐defined functions ("jobs"). | xref:BloombergLP/bdlmt/MultiQueueThreadPool.adoc[`MultiQueueThreadPool`] | This class implements a dynamic, configurable pool of queues, each of which is processed serially by a thread pool. | xref:BloombergLP/bdlmt/MultiQueueThreadPool_Queue.adoc[`MultiQueueThreadPool_Queue`] | This private class provides a thread‐safe, lightweight job queue. | xref:BloombergLP/bdlmt/MultipriorityThreadPool.adoc[`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. | xref:BloombergLP/bdlmt/Signaler.adoc[`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. | xref:BloombergLP/bdlmt/SignalerConnection.adoc[`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. | xref:BloombergLP/bdlmt/SignalerConnectionGuard.adoc[`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. | xref:BloombergLP/bdlmt/Signaler_ArgumentType.adoc[`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. | xref:BloombergLP/bdlmt/Signaler_Invocable-03.adoc[`Signaler_Invocable`] | Provides a call operator for the derived class `bdlmt::Signaler`, such that its call signature is identical to that of `t_PROT`. | xref:BloombergLP/bdlmt/Signaler_Node.adoc[`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. | xref:BloombergLP/bdlmt/Signaler_NotArg.adoc[`Signaler_NotArg`] | Provides a "Not an Argument" tag type. | xref:BloombergLP/bdlmt/Signaler_SlotNode.adoc[`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. | xref:BloombergLP/bdlmt/Signaler_SlotNode_Base.adoc[`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. | xref:BloombergLP/bdlmt/ThreadMultiplexor.adoc[`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. | xref:BloombergLP/bdlmt/ThreadPool.adoc[`ThreadPool`] | This class implements a thread pool used for concurrently executing multiple user‐defined functions ("jobs"). | xref:BloombergLP/bdlmt/ThreadPoolWaitNode.adoc[`ThreadPoolWaitNode`] | Component‐private node for the LIFO wait list of idle worker threads. | xref:BloombergLP/bdlmt/Throttle.adoc[`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`). | xref:BloombergLP/bdlmt/Throttle_InitHelper.adoc[`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` | xref:BloombergLP/bdlmt/TimerEventScheduler.adoc[`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. | xref:BloombergLP/bdlmt/TimerEventSchedulerDispatcher.adoc[`TimerEventSchedulerDispatcher`] | Dispatcher functor type for `TimerEventScheduler`. | xref:BloombergLP/bdlmt/TimerEventSchedulerTestTimeSource.adoc[`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`. | xref:BloombergLP/bdlmt/TimerEventSchedulerTestTimeSource_Data.adoc[`TimerEventSchedulerTestTimeSource_Data`] | Test time‐source data for `TimerEventScheduler` (testing only). |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlmt/FixedThreadPoolJobFunc.adoc[`FixedThreadPoolJobFunc`] | This type declares the prototype for functions that are suitable to be specified `bdlmt::FixedThreadPool::enqueueJob`. | xref:BloombergLP/bdlmt/ThreadPoolJobFunc.adoc[`ThreadPoolJobFunc`] | This type declares the prototype for functions that are suitable to be specified `bdlmt::FixedThreadPool::enqueueJob`. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlmt/ThreadPoolEntry.adoc[`ThreadPoolEntry`] | Entry point for processing threads. | xref:BloombergLP/bdlmt/swap-05.adoc[`swap`] | Swap the contents of the specified `a` and `b`. Throws nothing. | xref:BloombergLP/bdlmt/operator_eq.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` referring to the same slot and `false` otherwise. | xref:BloombergLP/bdlmt/operator_not_eq.adoc[`operator!=`] | Return `false` if the specified `lhs` and `rhs` referring to the same slot and `true` otherwise. | xref:BloombergLP/bdlmt/operator_lt.adoc[`operator<`] | Return `true` if the specified `lhs` is less than the specified `rhs` and `false` otherwise. | xref:BloombergLP/bdlmt/operator_le.adoc[`operator<=`] | Return `true` if the specified `lhs` is less than or equal to the specified `rhs` and `false` otherwise. | xref:BloombergLP/bdlmt/operator_gt.adoc[`operator>`] | Return `true` if the specified `lhs` is grater than the specified `rhs` and `false` otherwise. | xref:BloombergLP/bdlmt/operator_ge.adoc[`operator>=`] | Return `true` if the specified `lhs` is greater than or equal to the specified `rhs` and `false` otherwise. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#