|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Queue factory for requirements-based and compile-time queue selection. More...
#include <kcenon/thread/queue/queue_factory.h>#include <kcenon/thread/core/callback_job.h>#include <iostream>#include <string>#include <thread>#include <atomic>#include <vector>#include <chrono>
Go to the source code of this file.
Functions | |
| void | simple_factory_usage () |
| Example 1: Simple factory usage. | |
| void | requirements_based_selection () |
| Example 2: Requirements-based selection. | |
| void | optimal_selection () |
| Example 3: Optimal queue selection. | |
| void | compile_time_selection () |
| Example 4: Compile-time selection. | |
| void | practical_use_cases () |
| Example 5: Practical use cases. | |
| int | main () |
Queue factory for requirements-based and compile-time queue selection.
Definition in file queue_factory_sample.cpp.
| void compile_time_selection | ( | ) |
Example 4: Compile-time selection.
Shows how to use template-based type selection for zero-overhead queue selection.
Definition at line 177 of file queue_factory_sample.cpp.
Referenced by main().

| int main | ( | ) |
Definition at line 297 of file queue_factory_sample.cpp.
References compile_time_selection(), optimal_selection(), practical_use_cases(), requirements_based_selection(), and simple_factory_usage().

| void optimal_selection | ( | ) |
Example 3: Optimal queue selection.
Demonstrates automatic queue selection based on the runtime environment.
Definition at line 124 of file queue_factory_sample.cpp.
References kcenon::thread::queue_factory::create_optimal(), kcenon::thread::result< T >::is_ok(), and kcenon::thread::result< T >::value().
Referenced by main().


| void practical_use_cases | ( | ) |
Example 5: Practical use cases.
Demonstrates real-world scenarios where different queue types are appropriate.
Definition at line 212 of file queue_factory_sample.cpp.
References kcenon::thread::queue_factory::create_adaptive_queue(), kcenon::thread::queue_factory::create_standard_queue(), kcenon::thread::result< T >::is_ok(), and kcenon::thread::result< T >::value().
Referenced by main().


| void requirements_based_selection | ( | ) |
Example 2: Requirements-based selection.
Shows how to use requirements to automatically select the appropriate queue type. Returns scheduler_interface which provides schedule() and get_next_job() methods.
Definition at line 67 of file queue_factory_sample.cpp.
References kcenon::thread::queue_factory::create_for_requirements(), kcenon::thread::queue_factory::requirements::need_batch_operations, kcenon::thread::queue_factory::requirements::need_exact_size, and kcenon::thread::queue_factory::requirements::prefer_lock_free.
Referenced by main().


| void simple_factory_usage | ( | ) |
Example 1: Simple factory usage.
Demonstrates the basic factory methods for creating different queue types.
Definition at line 34 of file queue_factory_sample.cpp.
References kcenon::thread::adaptive, kcenon::thread::queue_factory::create_adaptive_queue(), kcenon::thread::queue_factory::create_standard_queue(), and kcenon::thread::standard.
Referenced by main().

