de | en

ThreadPool

On this page you can find an implementation of a thread-pool based on POSIX-threads. It builds a pool of p threads which are blocked until a job was given to the pool. Then an idle thread is chosen and the job is executed at this thread. If no idle thread is available, the pool blocks until one of the running jobs terminates.

The implementation is in C++ and should compile on most UNIX-systems (tested on Solaris and Linux).

The usage of the library is restricted to the terms of the GNU Lesser General Public License.

Documentation

The full documentation is available as a PDF file.

Source Code

The usage of the library is restricted to the terms of the GNU Lesser General Public License.

v0.8

  • using STL container instead of own classes thereby fixing several memory issues (thanks to Markus Schwienbacher for noticing).

v0.7

  • redesigned thread pool, now simpler and hopefully correct (no more race conditions)
  • simplified condition variables
  • simpler list interface (more like stl)
  • no more special types neccessary (types.hh)

v0.6

  • modified mutex and condition interface
  • again changed job synchronisation to avoid dead-locks
  • removed bugs in mutex unlocking (if already unlocked)

v0.5.1

  • changed thread-synchronisation to avoid dead-locks
  • added delete-flags to automatically remove job-objects if the thread finishes
  • updated docs (thanks to Jean Bouhnik)

v0.5

  • initial public release