Pthread Pool - a lightweight thread pool implemented using Pthreads.
Homepage: https://sourceforge.net/projects/pthread-pool/
E-mail: johngavingraham@googlemail.com
Overview
--------
Pthread-Pool aims to be an efficient, lightweight and safe thread pool
implementation using the Pthreads API.
Its main aims are:
* Consistency
Pthread-Pool aims to become a natural extension of the Pthreads
API - for example, all function names start with "pthread_pool_"
and use of the API and attributes is consistend with Pthreads.
* Efficiency
E.g. by using condition variables to allow worker threads to wait
for new tasks without spinning-up the CPU.
* Safety
All API calls are thread-safe - no external synchronization is
required.
* Simplicity
Pthread Pool depends only on the C standard library and the POSIX
threads library.
Usage
-----
A simple example is given in test/test-simple.c. See also the
pthread_pool_create.3 and pthread_pool.7 man pages in doc/.
The basic usage pattern is:
* Create a thread pool with pthread_pool_create().
* Add some worker threads with pthread_pool_worker_init().
* Add some tasks for the worker threads to do with
pthread_pool_task_init().
* Optionally, you can wait for all work to have finished with
pthread_pool_tryjoin().
* Collect the results with pthread_pool_join() or
pthread_pool_tryjoin().
Building
--------
You can build from the latest sources by checking-out the git
repository and following the steps under 'Development', below -
however, you will need some additional tools installed to generate
configure scripts and makefiles. To build without these, get the
latest source in .tar.gz form, which will allow you to perform the
standard ./configure && make && make install.
Development
-----------
From a clean install of Ubuntu 13.04 I had to install the following
packages to be able to do a complete build from checkout:
* build-essential
* autoconf
* libtool
* doxygen (for documentation only)
If you've just checked this project out from git (or if you've changed
one of the .ac/.am files) run `./autogen.sh'. It will copy some files
across; these are files it needs to work with your local copy of the
autotools, and so are deliberately untracked so they can be copied
across when you run autogen.sh.
At this stage you should have generated the files for you to do a
standard ./configure && make && make install.