Skip to content

Commit 813b324

Browse files
committed
docs: update documentation to reflect type-based thread pool architecture
Update all documentation files to align with the refactored thread pool system: - Replace priority-based terminology with type-based terminology - Update class names from priority_* to typed_* pattern - Revise API examples to use new typed_thread_pool interface - Modify benchmark descriptions for type-based scheduling - Ensure consistency between code implementation and documentation
1 parent ba9f724 commit 813b324

3 files changed

Lines changed: 43 additions & 45 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ This project addresses the fundamental challenge faced by developers worldwide:
100100
**Library Comparison** (540K jobs/sec baseline):
101101
| Library | Throughput | Relative Performance | Features |
102102
|---------|------------|---------------------|----------|
103-
| **Thread System** | 540K/s | 100% (baseline) | Priority, logging, C++20 |
103+
| **Thread System** | 540K/s | 100% (baseline) | Type-based, logging, C++20 |
104104
| Intel TBB | 580K/s | 107% | Industry standard |
105105
| Boost.Thread Pool | 510K/s | 94% | Header-only |
106106
| std::async | 125K/s | 23% | Standard library |
107107
| OpenMP | 495K/s | 92% | Compiler directives |
108108

109-
**Priority Thread Pool Performance**:
110-
| Priority Levels | Overhead vs Basic | Priority Accuracy | Use Case |
111-
|----------------|-------------------|-------------------|----------|
109+
**Type-based Thread Pool Performance**:
110+
| Job Type Levels | Overhead vs Basic | Type Accuracy | Use Case |
111+
|----------------|-------------------|---------------|----------|
112112
| Single | +3% | 100% | High-type only |
113113
| 2 Levels | +6% | 99.8% | Critical/Normal |
114114
| 3 Levels | +9% | 99.6% | High/Normal/Low |
@@ -168,15 +168,15 @@ For comprehensive performance analysis and optimization techniques, see the [Per
168168
### 4. [Type-based Thread Pool System (typed_thread_pool_module)](https://github.com/kcenon/thread_system/tree/main/sources/typed_thread_pool)
169169

170170
- `job_types` enum: Defines job type levels
171-
- `type_job` class: Defines job with type, inherits from `job`
172-
- `type_job_queue` class: Type-based job queue, inherits from `job_queue`
173-
- `type_thread_worker` class: Type-based worker thread, inherits from `thread_base`
174-
- `typed_thread_pool` class: Manages type-based thread pool
171+
- `typed_job_t` class: Defines job with type, inherits from `job`
172+
- `typed_job_queue_t` class: Type-based job queue, inherits from `job_queue`
173+
- `typed_thread_worker_t` class: Type-based worker thread, inherits from `thread_base`
174+
- `typed_thread_pool_t` class: Manages type-based thread pool
175175

176176
## Advanced Features & Capabilities
177177

178178
### 🎛️ **Intelligent Task Scheduling**
179-
- **Priority-aware job distribution**: Workers can handle multiple type levels with configurable responsibility lists
179+
- **Type-aware job distribution**: Workers can handle multiple type levels with configurable responsibility lists
180180
- **Dynamic type adaptation**: Runtime adjustment of worker responsibilities based on workload patterns
181181
- **FIFO guarantee**: Strict first-in-first-out ordering within same type levels
182182
- **Work stealing**: Automatic load balancing across worker threads
@@ -238,8 +238,8 @@ Our samples demonstrate real-world usage patterns and best practices:
238238
239239
- **[Asynchronous Logging](https://github.com/kcenon/thread_system/tree/main/samples/logger_sample/logger_sample.cpp)**: High-performance, multi-target logging system
240240
- **[Basic Thread Pool](https://github.com/kcenon/thread_system/tree/main/samples/thread_pool_sample/thread_pool_sample.cpp)**: Simple job processing with automatic load balancing
241-
- **[Priority Scheduling](https://github.com/kcenon/thread_system/tree/main/samples/typed_thread_pool_sample/typed_thread_pool_sample.cpp)**: Sophisticated type-based task management
242-
- **[Custom Priority Types](https://github.com/kcenon/thread_system/tree/main/samples/typed_thread_pool_sample_2/typed_thread_pool_sample_2.cpp)**: Extending the framework with domain-specific types
241+
- **[Type-based Scheduling](https://github.com/kcenon/thread_system/tree/main/samples/typed_thread_pool_sample/typed_thread_pool_sample.cpp)**: Sophisticated type-based task management
242+
- **[Custom Job Types](https://github.com/kcenon/thread_system/tree/main/samples/typed_thread_pool_sample_2/typed_thread_pool_sample_2.cpp)**: Extending the framework with domain-specific types
243243
244244
### 🛠️ **Build & Integration**
245245

benchmarks/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Core performance tests including:
1212
- Job submission latency
1313
- Job throughput with varying workloads
1414
- Scaling efficiency across multiple cores
15-
- Priority scheduling performance
15+
- Type-based scheduling performance
1616

1717
#### 2. **memory_benchmark.cpp**
1818
Memory usage analysis:
@@ -47,7 +47,7 @@ Stress tests and edge cases:
4747
- Rapid start/stop cycles
4848
- Exception handling under load
4949
- Memory pressure scenarios
50-
- Priority starvation tests
50+
- Type starvation tests
5151
- Thundering herd problem
5252
- Cascading failure simulation
5353

@@ -70,7 +70,7 @@ In-depth job throughput analysis:
7070
- Sustained throughput over time
7171
- Burst pattern handling
7272
- Job dependency impact
73-
- Priority scheduling overhead
73+
- Type-based scheduling overhead
7474
- Mixed workload scenarios
7575

7676
## Building Benchmarks

mainpage.dox

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This project addresses the fundamental challenge faced by developers worldwide:
1717
\subsection performance 🚀 Performance Excellence
1818
- **Zero-overhead abstractions**: Modern C++ design ensures minimal runtime cost
1919
- **Optimized data structures**: Lock-free algorithms and cache-friendly designs
20-
- **Adaptive scheduling**: Priority-based job processing for optimal resource utilization
20+
- **Adaptive scheduling**: Type-based job processing for optimal resource utilization
2121
- **Scalable architecture**: Linear performance scaling with hardware thread count
2222

2323
\subsection reliability 🛡️ Production-Grade Reliability
@@ -58,13 +58,13 @@ Efficient worker thread management:
5858
- **Factory functions**: Simple creation with sensible defaults
5959
- See namespace \ref thread_pool_module for implementation details
6060

61-
\subsection priority_thread_pool Priority Thread Pool System (priority_thread_pool_module)
62-
Advanced priority-based task scheduling:
63-
- **Configurable priorities**: Support for custom priority types and levels
64-
- **Worker specialization**: Per-worker priority responsibility assignment
65-
- **FIFO guarantee**: Strict ordering within same priority levels
66-
- **O(log n) operations**: Optimized priority queue implementation
67-
- See namespace \ref priority_thread_pool_module for advanced features
61+
\subsection typed_thread_pool Type-based Thread Pool System (typed_thread_pool_module)
62+
Advanced type-based task scheduling:
63+
- **Configurable job types**: Support for custom job type definitions and levels
64+
- **Worker specialization**: Per-worker type responsibility assignment
65+
- **FIFO guarantee**: Strict ordering within same type levels
66+
- **O(log n) operations**: Optimized type queue implementation
67+
- See namespace \ref typed_thread_pool_module for advanced features
6868

6969
\subsection utilities Supporting Utilities (utility_module)
7070
Essential infrastructure components:
@@ -109,31 +109,29 @@ Additional design considerations:
109109
\subsection five_minute 🚀 5-Minute Setup
110110

111111
\code{.cpp}
112-
#include "priority_thread_pool.h"
113-
using namespace priority_thread_pool_module;
112+
#include "typed_thread_pool.h"
113+
using namespace typed_thread_pool_module;
114114

115115
int main() {
116116
// 1. Initialize logging
117117
log_module::start();
118118

119-
// 2. Create priority thread pool
120-
auto pool = std::make_shared<priority_thread_pool_t<job_priorities>>();
119+
// 2. Create type-based thread pool
120+
auto pool = std::make_shared<typed_thread_pool_t<job_types>>();
121121

122122
// 3. Add workers with different responsibilities
123-
std::vector<std::unique_ptr<priority_thread_worker_t<job_priorities>>> workers;
124-
workers.push_back(std::make_unique<priority_thread_worker_t<job_priorities>>(
125-
std::vector<job_priorities>{job_priorities::High}));
126-
pool->enqueue_batch(std::move(workers));
123+
pool->add_worker(job_types::High); // High type specialist
124+
pool->add_worker({job_types::High, job_types::Normal}); // Multi-type worker
127125

128126
// 4. Start processing
129127
pool->start();
130128

131-
// 5. Submit jobs with priorities
132-
pool->enqueue(std::make_unique<callback_priority_job_t<job_priorities>>(
129+
// 5. Submit jobs with types
130+
pool->enqueue(std::make_unique<callback_typed_job_t<job_types>>(
133131
[]() -> result_void {
134-
log_module::write_info("Processing high-priority task");
132+
log_module::write_info("Processing high-type task");
135133
return {};
136-
}, job_priorities::High));
134+
}, job_types::High));
137135

138136
// 6. Clean shutdown
139137
pool->stop();
@@ -147,8 +145,8 @@ int main() {
147145
The library includes comprehensive sample code demonstrating:
148146
- **Basic logger usage**: High-performance, multi-target logging examples
149147
- **Thread pool processing**: Simple job processing with automatic load balancing
150-
- **Priority scheduling**: Sophisticated priority-based task management
151-
- **Custom priority types**: Extending framework with domain-specific priorities
148+
- **Type-based scheduling**: Sophisticated type-based task management
149+
- **Custom job types**: Extending framework with domain-specific types
152150
- **Error handling patterns**: Robust error management and recovery
153151
- **Performance optimization**: Benchmarking and tuning techniques
154152

@@ -277,18 +275,18 @@ Key classes:
277275
- thread_worker: Individual worker thread implementation
278276
- Factory functions for easy pool creation
279277

280-
\namespace priority_thread_pool_module
281-
\brief Priority-based thread pool implementation for job scheduling with priorities.
278+
\namespace typed_thread_pool_module
279+
\brief Type-based thread pool implementation for job scheduling with custom types.
282280

283-
The priority_thread_pool_module namespace extends the basic thread pool concept
284-
with priority-based scheduling of jobs, allowing tasks to be processed according
285-
to their importance rather than just their order of submission.
281+
The typed_thread_pool_module namespace extends the basic thread pool concept
282+
with type-based scheduling of jobs, allowing tasks to be processed according
283+
to their type classification rather than just their order of submission.
286284

287285
Key classes:
288-
- priority_thread_pool_t: Template-based priority pool
289-
- priority_thread_worker_t: Worker with priority awareness
290-
- priority_job_t: Jobs with associated priority levels
291-
- priority_job_queue_t: Priority-aware job queue
286+
- typed_thread_pool_t: Template-based type pool
287+
- typed_thread_worker_t: Worker with type awareness
288+
- typed_job_t: Jobs with associated type levels
289+
- typed_job_queue_t: Type-aware job queue
292290

293291
\namespace log_module
294292
\brief Thread-safe logging system built on the thread system foundation.

0 commit comments

Comments
 (0)