SObjectizer  5.8
Loading...
Searching...
No Matches
so_5::disp::mpsc_queue_traits Namespace Reference

Various stuff related to MPSC event queue implementation and tuning. More...

Namespaces

namespace  impl
 Implementation details for MPSC event queue stuff.
 

Classes

class  lock_guard_t
 An analog of std::lock_guard for MPSC queue lock. More...
 
class  lock_t
 An interface for lock for MPSC queue. More...
 
class  queue_params_t
 Container for storing parameters for MPSC queue. More...
 
class  unique_lock_t
 An analog of std::unique_lock for MPSC queue lock. More...
 

Typedefs

using lock_unique_ptr_t = std::unique_ptr< lock_t >
 An alias for unique_ptr for lock.
 
using lock_factory_t = std::function< lock_unique_ptr_t() >
 Type of lock factory.
 

Functions

std::chrono::high_resolution_clock::duration default_combined_lock_waiting_time ()
 Default timeout used by combined_lock for waiting on spinlock before switching to mutex-based locking scheme.
 
SO_5_FUNC lock_factory_t combined_lock_factory (std::chrono::high_resolution_clock::duration waiting_time)
 Factory for creation of combined queue lock with the specified waiting time.
 
lock_factory_t combined_lock_factory ()
 Factory for creation of combined queue lock with default waiting time.
 
SO_5_FUNC lock_factory_t simple_lock_factory ()
 Factory for creation of very simple implementation based on usage of mutex and condition_variable only.
 

Detailed Description

Various stuff related to MPSC event queue implementation and tuning.

Since
v.5.5.10

Typedef Documentation

◆ lock_factory_t

Type of lock factory.

Since
v.5.5.10
v.5.5.11

Definition at line 90 of file mpsc_queue_traits/pub.hpp.

◆ lock_unique_ptr_t

An alias for unique_ptr for lock.

Since
v.5.5.10
v.5.5.11

Definition at line 80 of file mpsc_queue_traits/pub.hpp.

Function Documentation

◆ combined_lock_factory() [1/2]

lock_factory_t so_5::disp::mpsc_queue_traits::combined_lock_factory ( )
inline

Factory for creation of combined queue lock with default waiting time.

Since
v.5.5.10

Definition at line 140 of file mpsc_queue_traits/pub.hpp.

◆ combined_lock_factory() [2/2]

SO_5_FUNC lock_factory_t so_5::disp::mpsc_queue_traits::combined_lock_factory ( std::chrono::high_resolution_clock::duration waiting_time)

Factory for creation of combined queue lock with the specified waiting time.

Usage example:
env,
"file_handler",
[]( so_5::disp::one_thread::queue_traits::queue_params_t & p ) {
p.lock_factory( so_5::disp::one_thread::queue_traits::combined_lock_factory(
// Switch to mutex after 125us of busy waiting.
std::chrono::microseconds{125}) );
} ) );
Alias for namespace with traits of event queue.
disp_params_t & tune_queue_params(L tunner)
Tuner for queue parameters.
SO_5_FUNC dispatcher_handle_t make_dispatcher(environment_t &env, const std::string_view data_sources_name_base, disp_params_t params)
Create an instance of one_thread dispatcher.
Since
v.5.5.10
Parameters
waiting_timeMax waiting time for waiting on spinlock before switching to mutex.

Definition at line 205 of file mpsc_queue_traits/pub.cpp.

◆ default_combined_lock_waiting_time()

std::chrono::high_resolution_clock::duration so_5::disp::mpsc_queue_traits::default_combined_lock_waiting_time ( )
inline

Default timeout used by combined_lock for waiting on spinlock before switching to mutex-based locking scheme.

Since
v.5.5.10

Definition at line 102 of file mpsc_queue_traits/pub.hpp.

◆ simple_lock_factory()

SO_5_FUNC lock_factory_t so_5::disp::mpsc_queue_traits::simple_lock_factory ( )

Factory for creation of very simple implementation based on usage of mutex and condition_variable only.

Since
v.5.5.10
Usage example:
env,
"file_handler",
[]( so_5::disp::one_thread::queue_traits::queue_params_t & p ) {
p.lock_factory( so_5::disp::one_thread::queue_traits::simple_lock_factory() );
} ) );

Definition at line 217 of file mpsc_queue_traits/pub.cpp.