diff options
author | Marat Dukhan <maratek@gmail.com> | 2019-10-19 05:41:08 -0400 |
---|---|---|
committer | Marat Dukhan <maratek@gmail.com> | 2019-10-19 05:41:08 -0400 |
commit | 88042a0d90c75662b492b3f0ddb6e644f36bd0b2 (patch) | |
tree | c0912d2385701062178193187012bdbc4edde231 | |
parent | f535e635d6cf56725360aecb6e6f5a507e48fac7 (diff) | |
download | pthreadpool-88042a0d90c75662b492b3f0ddb6e644f36bd0b2.tar.gz |
Update README and example
-rw-r--r-- | README.md | 18 | ||||
-rw-r--r-- | examples/addition.c | 7 |
2 files changed, 15 insertions, 10 deletions
@@ -3,16 +3,19 @@ [![BSD (2 clause) License](https://img.shields.io/badge/License-BSD%202--Clause%20%22Simplified%22%20License-blue.svg)](https://github.com/Maratyszcza/pthreadpool/blob/master/LICENSE) [![Build Status](https://img.shields.io/travis/Maratyszcza/pthreadpool.svg)](https://travis-ci.org/Maratyszcza/pthreadpool) -**pthreadpool** is a pthread-based thread pool implementation. -It is intended to provide functionality of `#pragma omp parallel for` for POSIX systems where OpenMP is not available. +**pthreadpool** is a portable and efficient thread pool implementation. +It provides similar functionality to `#pragma omp parallel for`, but with additional features. ## Features: * C interface (C++-compatible). +* 1D-6D loops with step parameters. * Run on user-specified or auto-detected number of threads. * Work-stealing scheduling for efficient work balancing. -* Compatible with Linux, macOS, and Native Client environments. -* Covered with unit tests and microbenchmarks. +* Wait-free synchronization of work items. +* Compatible with Linux (including Android), macOS, iOS, Emscripten, Native Client environments. +* 100% unit tests coverage. +* Throughput and latency microbenchmarks. ## Example @@ -37,10 +40,11 @@ int main() { printf("Created thread pool with %zu threads\n", threads_count); struct array_addition_context context = { augend, addend, sum }; - pthreadpool_compute_1d(threadpool, - (pthreadpool_function_1d_t) add_arrays, + pthreadpool_parallelize_1d(threadpool, + (pthreadpool_task_1d_t) add_arrays, (void**) &context, - ARRAY_SIZE); + ARRAY_SIZE, + PTHREADPOOL_FLAG_DISABLE_DENORMALS /* flags */); pthreadpool_destroy(threadpool); threadpool = NULL; diff --git a/examples/addition.c b/examples/addition.c index 687133c..de806df 100644 --- a/examples/addition.c +++ b/examples/addition.c @@ -28,10 +28,11 @@ int main() { printf("Created thread pool with %zu threads\n", threads_count); struct array_addition_context context = { augend, addend, sum }; - pthreadpool_compute_1d(threadpool, - (pthreadpool_function_1d_t) add_arrays, + pthreadpool_parallelize_1d(threadpool, + (pthreadpool_task_1d_t) add_arrays, (void**) &context, - ARRAY_SIZE); + ARRAY_SIZE, + PTHREADPOOL_FLAG_DISABLE_DENORMALS /* flags */); pthreadpool_destroy(threadpool); threadpool = NULL; |