Menu

Tree [cc0332] master /
 History

HTTPS access


File Date Author Commit
 doc 2013-09-30 John Graham John Graham [f3990a] Used sed to change "PthreadPool" to "Pthread Po...
 m4 2013-10-05 John Graham John Graham [70ea3e] Updated build system to keep macros in-tree (in...
 src 2013-10-07 John Graham John Graham [f7c586] Added a deadlock check to pthread_pool_join(), ...
 test 2013-10-07 John Graham John Graham [e7d85c] Added test for pthread_pool_join() deadlock check.
 .gitignore 2013-10-07 John Graham John Graham [f51a8a] Updated .gitignore so we don't need to edit it ...
 AUTHORS 2013-04-17 John Graham John Graham [916d9a] Initial commit.
 COPYING 2013-07-15 John Graham John Graham [cd9a04] Changed license to LGPL 2.1.
 ChangeLog 2013-10-07 John Graham John Graham [cc0332] Updated version number and ChangeLog.
 Makefile.am 2013-10-05 John Graham John Graham [70ea3e] Updated build system to keep macros in-tree (in...
 NEWS 2013-04-17 John Graham John Graham [916d9a] Initial commit.
 README 2013-10-05 John Graham John Graham [89b5cd] Fixed minor typo.
 TODO 2013-04-17 John Graham John Graham [916d9a] Initial commit.
 acinclude.m4 2013-10-05 John Graham John Graham [e90711] Added build support for doxygen, as per the gui...
 aminclude.am 2013-10-06 John Graham John Graham [5284df] Added doxygen comments to declarations in pthre...
 autogen.sh 2013-04-17 John Graham John Graham [916d9a] Initial commit.
 configure.ac 2013-10-07 John Graham John Graham [cc0332] Updated version number and ChangeLog.
 doxygen.cfg 2013-10-06 John Graham John Graham [5284df] Added doxygen comments to declarations in pthre...

Read Me

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.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.