diff options
author | Thomas White <taw@physics.org> | 2011-04-04 17:21:49 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:23 +0100 |
commit | 40ec8624ccd76c574a136603f3dc2fc6683be969 (patch) | |
tree | fa17bd5e6692a737221295a6c182fda631fc00c7 /src | |
parent | 91f002a61a483d33285bc7606e3ad5702dcf4460 (diff) |
Start documenting the thread pool
Diffstat (limited to 'src')
-rw-r--r-- | src/thread-pool.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/thread-pool.c b/src/thread-pool.c index dc041d2d..4a720efc 100644 --- a/src/thread-pool.c +++ b/src/thread-pool.c @@ -31,6 +31,20 @@ #include "utils.h" +/** + * SECTION:thread-pool + * @short_description: The thread pool + * @title: The thread pool + * @section_id: + * @see_also: + * @include: "thread-pool.h" + * @Image: + * + * The thread pool helps when running many tasks in parallel. It takes care of + * starting and stopping threads, and presents a relatively simple interface to + * the individual programs. + */ + /* ------------------------------ CPU affinity ------------------------------ */ #ifdef HAVE_CPU_AFFINITY @@ -182,6 +196,20 @@ static void *task_worker(void *pargsv) } +/** + * run_threads: + * @n_threads: The number of threads to run in parallel + * @work: The function to be called to do the work + * @get_task: The function which will determine the next unassigned task + * @final: The function which will be called to clean up after a task + * @queue_args: A pointer to any data required to determine the next task + * @max: Stop calling get_task() after starting this number of jobs + * @cpu_num: The number of CPUs in the system + * @cpu_groupsize: The group size into which the CPUs are grouped + * @cpu_offset: The CPU group number at which to start pinning threads + * + * Returns: The number of tasks completed. + **/ int run_threads(int n_threads, void (*work)(void *, int), void *(*get_task)(void *), void (*final)(void *, void *), void *queue_args, int max, |