[#BloombergLP-bdlmt]
= xref:BloombergLP.adoc[BloombergLP]::bdlmt
:relfileprefix: ../
:mrdocs:

Namespace for multithreaded timer and event scheduling components&period;

== Types

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/EventScheduler.adoc[`EventScheduler`] 
| This class provides a thread&hyphen;safe event scheduler that executes callbacks in a separate &quot;dispatcher thread&period;&quot; `start` must be invoked to start dispatching the callbacks&period; `stop` pauses the dispatching of the callbacks without removing the pending events&period;
| xref:BloombergLP/bdlmt/EventSchedulerEventHandle.adoc[`EventSchedulerEventHandle`] 
| Objects of this type refer to events in the `EventScheduler` API&period; They are convertible to `const Event&ast;` references and may be used in any method that expects them&period;
| xref:BloombergLP/bdlmt/EventSchedulerRecurringEventHandle.adoc[`EventSchedulerRecurringEventHandle`] 
| Objects of this type refer to recurring events in the `EventScheduler` API&period; They are convertible to `const RecurringEvent&ast;` references and may be used in any method which expects these&period;
| xref:BloombergLP/bdlmt/EventSchedulerTestTimeSource.adoc[`EventSchedulerTestTimeSource`] 
| This class provides a means to change the clock that is used by a given event&hyphen;scheduler to determine when events should be triggered&period; Constructing a `EventSchedulerTestTimeSource` alters the behavior of the supplied event&hyphen;scheduler&period; After a test time&hyphen;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&hyphen;source, and can be retrieved by calling `now` on that test time&hyphen;source&period; Note that the &quot;system&hyphen;time&quot; held by a test time&hyphen;source _does_ _not_ correspond to the current system time&period; Test writers must use caution when scheduling absolute&hyphen;time events so that they are scheduled relative to the test time&hyphen;source&apos;s value for `now`&period;
| xref:BloombergLP/bdlmt/EventSchedulerTestTimeSource_Data.adoc[`EventSchedulerTestTimeSource&lowbar;Data`] 
| Component&hyphen;private implementation of test time&hyphen;source state&period;
| xref:BloombergLP/bdlmt/FixedThreadPool.adoc[`FixedThreadPool`] 
| This class implements a thread pool used for concurrently executing multiple user&hyphen;defined functions (&quot;jobs&quot;)&period;
| 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&period;
| xref:BloombergLP/bdlmt/MultiQueueThreadPool_Queue.adoc[`MultiQueueThreadPool&lowbar;Queue`] 
| This private class provides a thread&hyphen;safe, lightweight job queue&period;
| xref:BloombergLP/bdlmt/MultipriorityThreadPool.adoc[`MultipriorityThreadPool`] 
| This class implements a thread&hyphen;enabled, integrally&hyphen;prioritized thread&hyphen;pool mechanism used for concurrently executing multiple user&hyphen;defined &quot;jobs&quot; supplied as either conventional C&hyphen;style functions taking an optional `void &ast;` data argument, or as more flexible functor objects&period;
| xref:BloombergLP/bdlmt/Signaler.adoc[`Signaler`] 
| This class template provides a thread&hyphen;safe signaler that executes connected slots when invoked via its call operator&period; `t&lowbar;PROT` is a function signature and must have a return type of `void`&period; The callable objects assigned to the slots may have return types other than `void`, in which case their return values will be discarded&period;
| xref:BloombergLP/bdlmt/SignalerConnection.adoc[`SignalerConnection`] 
| This `class` represents a connection between a signaler and a slot&period; 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&period; 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&period;
| 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&period; It also contains a boolean `waitOnDisconnect` attribute, which determines whether `disconnect` or `disconnectAndWait` is used to disconnect the slot&period; The `waitOnDisconnect` attribute is set in constructors from a `SignalerConnection` and propagated when move constructing or move assigning a guard to a different guard&period;
| xref:BloombergLP/bdlmt/Signaler_ArgumentType.adoc[`Signaler&lowbar;ArgumentType`] 
| For a function prototype `t&lowbar;PROT` of up to 9 arguments, provide types `ForwardingTypeN` which is the most convenient way to forward the `Nth` argument&period; &ast; as the type of argument N itself (in the case of some fundamental types) &ast; as a const reference (if `TypeN` is large and either by value or by const reference), or &ast; as a reference to a modifiable object, if that&apos;s how the argument was passed in the first place&period; 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&period;
| xref:BloombergLP/bdlmt/Signaler_Invocable-03.adoc[`Signaler&lowbar;Invocable`] 
| Provides a call operator for the derived class `bdlmt&colon;&colon;Signaler`, such that its call signature is identical to that of `t&lowbar;PROT`&period;
| xref:BloombergLP/bdlmt/Signaler_Node.adoc[`Signaler&lowbar;Node`] 
| Provides the implementation of a signaler&period; This object has a 1&hyphen;1 relationship with the `Signaler`, which has a shared pointer to it&period; This allows other objects to refer to it via shared and weak pointers&period; This allows `SignalerConnection` objects to outlive the &grave;Signaler &hyphen; Signaler&lowbar;Node&grave; pair, since they can test or lock weak pointers to see if the `Signaler&lowbar;Node` still exists when they are trying to disconnect themselves&period;
| xref:BloombergLP/bdlmt/Signaler_NotArg.adoc[`Signaler&lowbar;NotArg`] 
| Provides a &quot;Not an Argument&quot; tag type&period;
| xref:BloombergLP/bdlmt/Signaler_SlotNode.adoc[`Signaler&lowbar;SlotNode`] 
| Dynamically&hyphen;allocated container for one slot, containing a function object that can be called by a signaler&period; Owned by a shared pointer in a skip list container in the `Signaler&lowbar;Node`&period; Also referred to by weak pointers from `SignalerConnection` objects&period;
| xref:BloombergLP/bdlmt/Signaler_SlotNode_Base.adoc[`Signaler&lowbar;SlotNode&lowbar;Base`] 
| Provide a non&hyphen;template protocol base class for `Signaler&lowbar;SlotNode` so `SignalerConnection` objects, which are not templated, can refer to and manipulate `Signaler&lowbar;SlotNode` objects&period;
| xref:BloombergLP/bdlmt/ThreadMultiplexor.adoc[`ThreadMultiplexor`] 
| This class provides a mechanism for facilitating the use of multiple threads to perform various user&hyphen;defined functions (&quot;jobs&quot;) when some degree of collaboration between threads is required&period; The thread multiplexor is configured with a total number of &quot;processors&quot;, representing the number of threads that may process jobs at any particular time&period; Additional threads enqueue jobs to a pending job queue, which is processed by the next available processing thread&period;
| xref:BloombergLP/bdlmt/ThreadPool.adoc[`ThreadPool`] 
| This class implements a thread pool used for concurrently executing multiple user&hyphen;defined functions (&quot;jobs&quot;)&period;
| xref:BloombergLP/bdlmt/ThreadPoolWaitNode.adoc[`ThreadPoolWaitNode`] 
| Component&hyphen;private node for the LIFO wait list of idle worker threads&period;
| 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&period; The data members of `Throttle` are currently public to allow for compile&hyphen;time (aggregate) initialization of `Throttle` objects having static storage duration (for C&plus;&plus;03 compilers that do not provide `constexpr`)&period;
| xref:BloombergLP/bdlmt/Throttle_InitHelper.adoc[`Throttle&lowbar;InitHelper`] 
| &lsqb;*PRIVATE*&rsqb;This component private meta&hyphen;function is used to implement the initialization macros&period; This type provides the following&colon; &ast; Ensures arguments are evaluated at compile time (which won&apos;t be the case for floating point arguments) &ast; Enables compile time checks with BSLMF&lowbar;ASSERT &ast; Handles special cases if 0 is passed for `t&lowbar;MAX&lowbar;SIMULTANEOUS&lowbar;ACTIONS` or `t&lowbar;NANOSECONDS&lowbar;PER&lowbar;ACTION`
| xref:BloombergLP/bdlmt/TimerEventScheduler.adoc[`TimerEventScheduler`] 
| This class provides a thread&hyphen;safe event scheduler&period; `scheduleEvent` schedules a non&hyphen;recurring event, returning a handle of type `TimerEventScheduler&colon;&colon;Handle`, which can be used to cancel the scheduled event by invoking `cancelEvent`&period; Similarly, `startClock` schedules a recurring event, returning a handle of type `TimerEventScheduler&colon;&colon;Handle`, which can be used to cancel the clock by invoking `cancelClock`&period; `cancelAllEvents` cancels all the registered events and `cancelAllClocks` cancels all the registered clocks&period; The callbacks are processed by a separate thread (called dispatcher thread)&period; 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 &quot;The dispatcher thread and the dispatcher functor&quot;)&period; `start` must be invoked to start dispatching the callbacks&period; `stop` stops the dispatching of the callbacks without removing the pending events&period;
| xref:BloombergLP/bdlmt/TimerEventSchedulerDispatcher.adoc[`TimerEventSchedulerDispatcher`] 
| Dispatcher functor type for `TimerEventScheduler`&period;
| xref:BloombergLP/bdlmt/TimerEventSchedulerTestTimeSource.adoc[`TimerEventSchedulerTestTimeSource`] 
| This class provides a means to change the clock that is used by a given event&hyphen;scheduler to determine when events should be triggered&period; Constructing a `TimerEventSchedulerTestTimeSource` alters the behavior of the supplied event&hyphen;scheduler&period; After a test time&hyphen;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&hyphen;source, and can be retrieved by calling `now` on that test time&hyphen;source&period; Note that the &quot;system&hyphen;time&quot; held by a test time&hyphen;source _does_ _not_ correspond to the current system time&period; Test writers must use caution when scheduling absolute&hyphen;time events so that they are scheduled relative to the test time&hyphen;source&apos;s value for `now`&period;
| xref:BloombergLP/bdlmt/TimerEventSchedulerTestTimeSource_Data.adoc[`TimerEventSchedulerTestTimeSource&lowbar;Data`] 
| Test time&hyphen;source data for `TimerEventScheduler` (testing only)&period;
|===


== 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&colon;&colon;FixedThreadPool&colon;&colon;enqueueJob`&period;
| xref:BloombergLP/bdlmt/ThreadPoolJobFunc.adoc[`ThreadPoolJobFunc`] 
| This type declares the prototype for functions that are suitable to be specified `bdlmt&colon;&colon;FixedThreadPool&colon;&colon;enqueueJob`&period;
|===


== Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/ThreadPoolEntry.adoc[`ThreadPoolEntry`] 
| Entry point for processing threads&period;
| xref:BloombergLP/bdlmt/swap-05.adoc[`swap`] 
| Swap the contents of the specified `a` and `b`&period; Throws nothing&period;
| xref:BloombergLP/bdlmt/operator_eq.adoc[`operator&equals;&equals;`] 
| Return `true` if the specified `lhs` and `rhs` referring to the same slot and `false` otherwise&period;
| xref:BloombergLP/bdlmt/operator_not_eq.adoc[`operator!&equals;`] 
| Return `false` if the specified `lhs` and `rhs` referring to the same slot and `true` otherwise&period;
| xref:BloombergLP/bdlmt/operator_lt.adoc[`operator&lt;`] 
| Return `true` if the specified `lhs` is less than the specified `rhs` and `false` otherwise&period;
| xref:BloombergLP/bdlmt/operator_le.adoc[`operator&lt;&equals;`] 
| Return `true` if the specified `lhs` is less than or equal to the specified `rhs` and `false` otherwise&period;
| xref:BloombergLP/bdlmt/operator_gt.adoc[`operator&gt;`] 
| Return `true` if the specified `lhs` is grater than the specified `rhs` and `false` otherwise&period;
| xref:BloombergLP/bdlmt/operator_ge.adoc[`operator&gt;&equals;`] 
| Return `true` if the specified `lhs` is greater than or equal to the specified `rhs` and `false` otherwise&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
