13 -> std::unique_ptr<scheduler_interface>
16 if (reqs.need_exact_size || reqs.need_atomic_empty ||
17 reqs.need_batch_operations || reqs.need_blocking_wait) {
18 return std::make_unique<job_queue>();
24 if (reqs.prefer_lock_free) {
29 return std::make_unique<adaptive_job_queue>();
35#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)
36 constexpr bool strong_memory_model =
true;
39 constexpr bool strong_memory_model =
false;
43 if (!strong_memory_model) {
44 return std::make_unique<job_queue>();
48 const auto core_count = std::thread::hardware_concurrency();
49 if (core_count <= 2) {
50 return std::make_unique<job_queue>();
54 return std::make_unique<adaptive_job_queue>();
59 return std::make_unique<standard_queue>();
64 return std::make_unique<policy_lockfree_queue>();
@ performance_first
Always use lock-free mode.
Policy that limits queue size to a maximum.
Synchronization policy using mutex and condition variable.
Policy that rejects new items when queue is full.
Policy-based queue template.
static auto create_optimal() -> std::unique_ptr< scheduler_interface >
Create optimal queue for current environment.
static auto create_policy_queue() -> std::unique_ptr< standard_queue >
Create a standard policy_queue (mutex-based, unbounded)
static auto create_bounded_policy_queue(std::size_t max_size) -> std::unique_ptr< policy_queue< policies::mutex_sync_policy, policies::bounded_policy, policies::overflow_reject_policy > >
Create a bounded policy_queue with specified size.
static auto create_lockfree_policy_queue() -> std::unique_ptr< policy_lockfree_queue >
Create a lock-free policy_queue.
static auto create_for_requirements(const requirements &reqs) -> std::unique_ptr< scheduler_interface >
Create queue based on requirements.
Core threading foundation of the thread system library.
Policy-based job queue template with customizable sync, bound, and overflow.
Factory for creating queue instances based on configuration.
Queue selection requirements.