• Stars
    star
    847
  • Rank 53,812 (Top 2 %)
  • Language
    C
  • License
    BSD 2-Clause "Sim...
  • Created over 13 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple C Thread pool implementation

Build Status

A simple C thread pool implementation

Currently, the implementation:

  • Works with pthreads only, but API is intentionally opaque to allow other implementations (Windows for instance).
  • Starts all threads on creation of the thread pool.
  • Reserves one task for signaling the queue is full.
  • Stops and joins all worker threads on destroy.

Possible enhancements

The API contains additional unused 'flags' parameters that would allow some additional options:

  • Lazy creation of threads (easy)
  • Reduce number of threads automatically (hard)
  • Unlimited queue size (medium)
  • Kill worker threads on destroy (hard, dangerous)
  • Support Windows API (medium)
  • Reduce locking contention (medium/hard)