lzpong/threadpool
based on C++11 , a mini threadpool , accept variable number of parameters 基于C++11的线程池,简洁且可以带任意多的参数 observed · 2026-08-28
Health v2 · maintenance only
76/100
- Activity 98
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3487
- days_rel: n/a
- days_push: 14
- n_releases_24m: 0
Adoption not part of the score
1138 stars · 356 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A minimal (~300 line) C++11 header-only thread pool that accepts variadic functions and lambdas and returns std::future results. It features a bounded task queue with backpressure, optional auto-growing threads with idle reclamation, and exception safety.
Use cases
- run tasks concurrently with a thread pool in C++
- submit lambdas with arbitrary arguments and get results via futures
- limit concurrent worker threads with a bounded task queue
- auto-scale thread count and reclaim idle threads
- learn C++11 concurrency idioms like packaged_task and condition_variable
When to choose
- you need a tiny, dependency-free C++11 thread pool
- you want variadic task submission with future return values
- you need backpressure via a bounded queue
- you want a readable implementation to study C++11 threading
When to avoid
- you need advanced features like work stealing, priorities, or cancellation
- you need direct support for class member functions without bind/mem_fn
- your tasks submit and wait on subtasks in the same pool (deadlock risk)
- you need a production-grade pool with extensive tuning and metrics
Facets
library · maturity stable
concurrency developer-tools developer-tools performance cpp cross-platform windows thread-pool c++11 header-only task-queue future backpressure mini algorithms linux macos
2 sources
- readme: https://github.com/lzpong/threadpool · fetched 2026-08-28 · 6c0faf9a0721
- homepage: http://www.cnblogs.com/lzpong/p/6397997.html · fetched 2026-08-29 · bf2bbb175f88
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| lzpong/threadpool | main | 76 |
For agents
markdown · JSON · MCP: product_card(name="lzpong/threadpool")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem