|
SObjectizer
5.8
|
Reusable components for dispatchers. More...
Namespaces | |
| namespace | locks |
| Implementation of various types of locks to be used inside dispatchers. | |
| namespace | thread_pool_stats |
| Helper tools for implementation of run-time monitoring for thread-pool-like dispatchers. | |
| namespace | work_thread |
| Implemetation details of dispatcher's working thread. | |
Classes | |
| class | queue_of_queues_t |
| Multi-producer/Multi-consumer queue of pointers to event queues. More... | |
| class | work_thread_activity_tracking_flag_mixin_t |
| Mixin with thread activity tracking flag. More... | |
| class | work_thread_factory_mixin_t |
| Mixin that holds optional work thread factory. More... | |
Functions | |
| template<typename Params > | |
| abstract_work_thread_factory_shptr_t | actual_work_thread_factory_to_use (const work_thread_factory_mixin_t< Params > ¶ms, const environment_t &env) noexcept |
| Helper to detect actual work thread factory to be used. | |
| template<typename Params > | |
| work_thread_holder_t | acquire_work_thread (const work_thread_factory_mixin_t< Params > ¶ms, environment_t &env) |
| Helper function for acquiring a new worker thread from an appropriate work thread factory. | |
| so_5::stats::prefix_t | make_disp_prefix (const std::string_view disp_type, const std::string_view data_sources_name_base, const void *disp_this_pointer) |
| Create basic prefix for dispatcher data source names. | |
| so_5::stats::prefix_t | make_disp_working_thread_prefix (const so_5::stats::prefix_t &disp_prefix, std::size_t thread_number) |
| Create prefix for dispatcher's working thread data source. | |
| template<typename Disp_Params_Type > | |
| void | modify_disp_params (so_5::environment_t &env, Disp_Params_Type ¶ms) |
| Helper functions to adjust some dispatcher parameters with respect to settings from environment. | |
| template<typename Disp_Iface_Type , typename Disp_No_Tracking , typename Disp_With_Tracking , typename Disp_Params_Type , typename... Args> | |
| std::unique_ptr< Disp_Iface_Type > | make_actual_dispatcher (outliving_reference_t< environment_t > env, const std::string_view name_base, Disp_Params_Type disp_params, Args &&...args) |
| Helper function for creation of dispatcher instance with respect to work thread activity tracking flag. | |
| std::size_t | default_thread_pool_size () |
| A helper function for detecting default thread count for thread pool. | |
Reusable components for dispatchers.
This namespace contains classes and functions which can be reused by various types of dispatchers.
|
nodiscard |
Helper function for acquiring a new worker thread from an appropriate work thread factory.
If params defines a factory then the factory from params is used for acquiring new work thread. Otherwise the factory from env is used.
Definition at line 69 of file actual_work_thread_factory_to_use.hpp.
|
nodiscardnoexcept |
Helper to detect actual work thread factory to be used.
If params defines a factory then the factory from params is returned. Otherwise, the factory from env is returned.
Definition at line 43 of file actual_work_thread_factory_to_use.hpp.
|
inlinenodiscard |
A helper function for detecting default thread count for thread pool.
Returns value of std::thread::hardware_concurrency() or 2 if hardware_concurrency() returns 0.
Definition at line 31 of file default_thread_pool_size.hpp.
| std::unique_ptr< Disp_Iface_Type > so_5::disp::reuse::make_actual_dispatcher | ( | outliving_reference_t< environment_t > | env, |
| const std::string_view | name_base, | ||
| Disp_Params_Type | disp_params, | ||
| Args &&... | args ) |
Helper function for creation of dispatcher instance with respect to work thread activity tracking flag.
| Disp_Iface_Type | a type of interface for actual dispatcher. This type is expected to be a base class for Disp_No_Tracking and Disp_With_Tracking types. |
| Disp_No_Tracking | a type of dispatcher for case when thread activity tracking is not used. |
| Disp_With_Tracking | a type of dispatcher for case when thread activity tracking is used. |
| Disp_Params_Type | a type of dispatcher-specific parameters. |
| Args | types of additional arguments for dispatcher's constructor. |
Definition at line 97 of file make_actual_dispatcher.hpp.
|
inline |
Create basic prefix for dispatcher data source names.
| disp_type | Textual marker of dispatcher type (like ot, ao, ag, tp, atp, ...). |
| data_sources_name_base | User-supplied optional base for name. Can be empty. |
| disp_this_pointer | Pointer to dispatcher instance. Will be used if data_sources_name_base is empty. |
Definition at line 36 of file data_source_prefix_helpers.hpp.
|
inline |
Create prefix for dispatcher's working thread data source.
| disp_prefix | Prefix for the dispatcher. |
| thread_number | Thread ordinal number. |
Definition at line 66 of file data_source_prefix_helpers.hpp.
| void so_5::disp::reuse::modify_disp_params | ( | so_5::environment_t & | env, |
| Disp_Params_Type & | params ) |
Helper functions to adjust some dispatcher parameters with respect to settings from environment.
If dispatcher params doesn't have lock-factory specified the lock-factory will be inherited from environment.
| Disp_Params_Type | type of struct/class with dispatcher-related parameters. This type should have queue_params() method. |
Definition at line 42 of file make_actual_dispatcher.hpp.