Thread Pool Example
This example is a self-contained test suite that exercises the full public API
of espp::ThreadPool across a range of usage patterns, from basic single-pool
operation to more advanced concurrent and multi-pool scenarios.
# |
Test |
APIs covered |
|---|---|---|
1 |
Lifecycle |
|
2 |
Normal dispatch |
|
3 |
Bounded-queue rejection |
|
4 |
Blocking submit |
|
5 |
Post-stop rejection |
|
6 |
Concurrent lifecycle |
multi-thread |
7 |
Concurrent submission |
multi-thread |
8 |
Chained pools |
a job in |
9 |
Self-submit |
a running job submitting back to its own pool |
Each test logs individual PASS / FAIL results inline. At the end of the run
a summary is printed:
==================== Results ====================
PASS lifecycle: start/stop/is_running/worker_count
PASS submit: normal dispatch + queue_size + stats
...
=================================================
9/9 tests passed
All tests passed!
The final summary line (N/N tests passed / N test(s) FAILED) is the key
indicator of overall correctness and is suitable for CI log parsing.
Build
From this directory, run:
idf.py set-target esp32
idf.py build flash monitor