# lzpong/threadpool

based on C++11 , a mini threadpool , accept variable number of parameters 基于C++11的线程池,简洁且可以带任意多的参数

Repository: https://github.com/lzpong/threadpool
Canonical: https://ross.abutalabs.com/products/lzpong-threadpool
Homepage: http://www.cnblogs.com/lzpong/p/6397997.html
Language: C++
License: MIT
License Family: permissive
Topics: threadpool, thread-pool, mini
Last push: 2026-08-19T09:30:17+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 35, longevity 100
- inputs: {"age_days": 3487, "days_push": 14, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1138, forks 356 (observed 2026-08-28T04:03:44.052905+00:00)

## What it is
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
- artifact type: library
- maturity: stable
- function: concurrency, developer-tools
- domain: developer-tools, performance
- platform: cpp, cross-platform, windows
- tags: thread-pool, c++11, header-only, task-queue, future, backpressure, mini, algorithms, linux, macos

## Member repositories
- lzpong/threadpool (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:44.052905+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:36:09.953001+00:00, confidence not recorded.
  - readme: https://github.com/lzpong/threadpool (fetched 2026-08-28T04:03:44.052905+00:00, sha 6c0faf9a0721)
  - homepage: http://www.cnblogs.com/lzpong/p/6397997.html (fetched 2026-08-29T12:41:11.586287+00:00, sha bf2bbb175f88)
- Data as of 2026-08-30T08:39:29.467469+00:00.
