Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 812 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 812 Bytes

A thread pool implementation in C

Modernized version of the thread pool used in a internship project in 2015

Recap

  • why thread pool?
    1. the original project was for running a hospital signup server on an embedded system. It has limited resources. A number of the maximum concurrent thread must be set.
    2. In the meantime, having a few thread stand-by for incoming jobs saves the overhead creating new threads for every connection .

Design

  • threadpool.c
  • threadpool.h

API

thread_pool_t *pool = thread_pool_create(4, 100, 0);
thread_pool_submit(pool, compute, (void *)(i));
// ...
thread_pool_destroy(pool);

Status

Used to be a TCP server talking in json to destop Qt clients. I am extending it into a http server.