Skip to content

tonyxwz/server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

TCP server with thread pool and epoll.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages