Skip to content

About

C thread pool implementation using POSIX threads (pthreads)

Resources

Stars

1 star

Watchers

2 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

c-pthread-pool

C thread pool implementation using POSIX threads (pthreads).

Usage

#include "threadpool.h"

struct worker_arg {
    char* filepath;
    int writefd;
};

// Create the thread pool with 8 threads
threadpool_t* tpool = create_thread_pool(8);

// Enqueue work for the thread pool
struct worker_arg warg;
warg.filepath = buffer;
warg.writefd = writefd;
enqueue_thread_pool(tpool, file_worker, &warg);

void* file_worker(void* arg) {
    // Parse the worker_arg
    struct worker_arg* warg = (struct worker_arg*) arg;
}

About

C thread pool implementation using POSIX threads (pthreads)

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages