|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Thread pool sample with logger integration and batch job submission. More...
#include <iostream>#include <memory>#include <chrono>#include "logger/core/logger.h"#include <kcenon/thread/utils/formatter.h>#include <kcenon/thread/core/thread_pool.h>
Go to the source code of this file.
Functions | |
| auto | initialize_logger () -> std::optional< std::string > |
| auto | create_default (const uint16_t &worker_counts) -> std::tuple< std::shared_ptr< thread_pool >, kcenon::common::VoidResult > |
| auto | store_job (std::shared_ptr< thread_pool > thread_pool) -> kcenon::common::VoidResult |
| auto | main () -> int |
Variables | |
| bool | use_backup_ = false |
| uint32_t | max_lines_ = 0 |
| uint16_t | wait_interval_ = 100 |
| uint32_t | test_line_count_ = 1000000 |
| log_module::log_types | file_target_ = log_module::log_types::None |
| log_module::log_types | console_target_ = log_module::log_types::Information |
| log_module::log_types | callback_target_ = log_module::log_types::None |
| uint16_t | thread_counts_ = 10 |
Thread pool sample with logger integration and batch job submission.
Definition in file thread_pool_sample.cpp.
| auto create_default | ( | const uint16_t & | worker_counts | ) | -> std::tuple<std::shared_ptr<thread_pool>, kcenon::common::VoidResult> |
Definition at line 59 of file thread_pool_sample.cpp.
Referenced by main().

| auto initialize_logger | ( | ) | -> std::optional<std::string> |
Definition at line 38 of file thread_pool_sample.cpp.
References callback_target_, console_target_, file_target_, kcenon::thread::utils::formatter::format(), max_lines_, use_backup_, and wait_interval_.
Referenced by main().


| auto main | ( | ) | -> int |
Definition at line 118 of file thread_pool_sample.cpp.
References create_default(), kcenon::thread::utils::formatter::format(), initialize_logger(), kcenon::thread::thread_pool::start(), kcenon::thread::thread_pool::stop(), store_job(), thread_counts_, and kcenon::thread::thread_pool::to_string().

| auto store_job | ( | std::shared_ptr< thread_pool > | thread_pool | ) | -> kcenon::common::VoidResult |
Definition at line 92 of file thread_pool_sample.cpp.
References kcenon::thread::thread_pool::enqueue_batch(), and test_line_count_.
Referenced by main().


| log_module::log_types callback_target_ = log_module::log_types::None |
Definition at line 34 of file thread_pool_sample.cpp.
Referenced by initialize_logger().
| log_module::log_types console_target_ = log_module::log_types::Information |
Definition at line 33 of file thread_pool_sample.cpp.
Referenced by initialize_logger().
| log_module::log_types file_target_ = log_module::log_types::None |
Definition at line 32 of file thread_pool_sample.cpp.
Referenced by initialize_logger().
| uint32_t max_lines_ = 0 |
Definition at line 29 of file thread_pool_sample.cpp.
Referenced by initialize_logger().
| uint32_t test_line_count_ = 1000000 |
Definition at line 31 of file thread_pool_sample.cpp.
Referenced by store_job().
| uint16_t thread_counts_ = 10 |
Definition at line 36 of file thread_pool_sample.cpp.
Referenced by main().
| bool use_backup_ = false |
Definition at line 28 of file thread_pool_sample.cpp.
Referenced by initialize_logger().
| uint16_t wait_interval_ = 100 |
Definition at line 30 of file thread_pool_sample.cpp.
Referenced by initialize_logger().