Skip to content

austingebauer/c-pthread-pool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages