All Projects → Maratyszcza → Pthreadpool

Maratyszcza / Pthreadpool

Licence: bsd-2-clause
Portable (POSIX/Windows/Emscripten) thread pool for C/C++

Projects that are alternatives of or similar to Pthreadpool

Ringojs
RingoJS is a JavaScript platform built on the JVM and optimized for server-side applications.
Stars: ✭ 777 (+326.92%)
Mutual labels:  multi-threading
Zxpoly
ZX-Poly platform info page and its emulator. It is a multi-CPU ZXSpectrum clone.
Stars: ✭ 60 (-67.03%)
Mutual labels:  multi-threading
Pspider
简单易用的Python爬虫框架,QQ交流群:597510560
Stars: ✭ 1,611 (+785.16%)
Mutual labels:  multi-threading
Overdrive
⚡️ Fast async task based Swift framework with focus on type safety, concurrency and multi threading
Stars: ✭ 823 (+352.2%)
Mutual labels:  multi-threading
Adapt
Advanced Developer Async Programming Toolkit
Stars: ✭ 26 (-85.71%)
Mutual labels:  multi-threading
Hyperhdr
Open source ambilight implementation for the audio and video stream on Windows 10 and Linux (x86 and Raspberry Pi). Primarily for use with the movie content on your TV and the LED strip. Includes support for HDR10 tone mapping correction for video processing and multi-threading for better performance.
Stars: ✭ 71 (-60.99%)
Mutual labels:  multi-threading
H2o 3
H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.
Stars: ✭ 5,656 (+3007.69%)
Mutual labels:  multi-threading
Netstack
Lightweight toolset for creating concurrent networking systems for multiplayer games
Stars: ✭ 157 (-13.74%)
Mutual labels:  multi-threading
Atmsimulator
Used the notion of threads and parallelism to make a ATM Simulator.
Stars: ✭ 11 (-93.96%)
Mutual labels:  multi-threading
Admin Finder
Blazing fast admin panel finder with asyncio and aiohttp
Stars: ✭ 113 (-37.91%)
Mutual labels:  multi-threading
Multi Threading Camera Stream
Multi-threading camera stream to improve video processing performance
Stars: ✭ 18 (-90.11%)
Mutual labels:  multi-threading
Liblist
Generic Linked list Management Library in C
Stars: ✭ 22 (-87.91%)
Mutual labels:  multi-threading
Smmalloc Csharp
Blazing fast memory allocator designed for video games meets .NET
Stars: ✭ 81 (-55.49%)
Mutual labels:  multi-threading
Fucking Java Concurrency
🎏 Simple show cases of java concurrency problems, seeing 🙈 is believing 🐵
Stars: ✭ 779 (+328.02%)
Mutual labels:  multi-threading
Arduino Scheduler
Portable Cooperative Multi-tasking Scheduler for Arduino
Stars: ✭ 127 (-30.22%)
Mutual labels:  multi-threading
Sqlitedict
Persistent dict, backed by sqlite3 and pickle, multithread-safe.
Stars: ✭ 641 (+252.2%)
Mutual labels:  multi-threading
Tdp
The Darkest Pipeline - Multithreaded pipelines for modern C++
Stars: ✭ 67 (-63.19%)
Mutual labels:  multi-threading
Crayon
A small, portable and extensible game framework written in Rust.
Stars: ✭ 163 (-10.44%)
Mutual labels:  multi-threading
Sqlcell
SQLCell is a magic function for the Jupyter Notebook that executes raw, parallel, parameterized SQL queries with the ability to accept Python values as parameters and assign output data to Python variables while concurrently running Python code. And *much* more.
Stars: ✭ 145 (-20.33%)
Mutual labels:  multi-threading
Mofuw
mofuw is *MO*re *F*aster, *U*ltra minimal *W*ebserver.
Stars: ✭ 107 (-41.21%)
Mutual labels:  multi-threading

pthreadpool

BSD (2 clause) License Build Status

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.
  • Wait-free synchronization of work items.
  • Compatible with Linux (including Android), macOS, iOS, Windows, Emscripten environments.
  • 100% unit tests coverage.
  • Throughput and latency microbenchmarks.

Example

The following example demonstates using the thread pool for parallel addition of two arrays:

static void add_arrays(struct array_addition_context* context, size_t i) {
  context->sum[i] = context->augend[i] + context->addend[i];
}

#define ARRAY_SIZE 4

int main() {
  double augend[ARRAY_SIZE] = { 1.0, 2.0, 4.0, -5.0 };
  double addend[ARRAY_SIZE] = { 0.25, -1.75, 0.0, 0.5 };
  double sum[ARRAY_SIZE];

  pthreadpool_t threadpool = pthreadpool_create(0);
  assert(threadpool != NULL);

  const size_t threads_count = pthreadpool_get_threads_count(threadpool);
  printf("Created thread pool with %zu threads\n", threads_count);

  struct array_addition_context context = { augend, addend, sum };
  pthreadpool_parallelize_1d(threadpool,
    (pthreadpool_task_1d_t) add_arrays,
    (void*) &context,
    ARRAY_SIZE,
    PTHREADPOOL_FLAG_DISABLE_DENORMALS /* flags */);

  pthreadpool_destroy(threadpool);
  threadpool = NULL;

  printf("%8s\t%.2lf\t%.2lf\t%.2lf\t%.2lf\n", "Augend",
    augend[0], augend[1], augend[2], augend[3]);
  printf("%8s\t%.2lf\t%.2lf\t%.2lf\t%.2lf\n", "Addend",
    addend[0], addend[1], addend[2], addend[3]);
  printf("%8s\t%.2lf\t%.2lf\t%.2lf\t%.2lf\n", "Sum",
    sum[0], sum[1], sum[2], sum[3]);

  return 0;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].