Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workerpool

A simple worker pool implementation. Supports starting an arbitrary number of worker threads and passing data to the threads.

Example:

/* Gets called on worker startup */
void init_callback(int id, void *user)
{
    puts("Initializing worker");
}

/* Gets called until the worker is shut down */
void work_callback(int id, void *user)
{
    puts("Working");
}

/* Gets called on worker shut down */
void deinit_callback(int id, void *user)
{
    puts("Deinitializing worker");
}

int main(int argc, char **argv)
{
    /* Start workers */
    WorkerPool *wpool = workerpool_init(5, &init_callback,
                                        &work_callback, &deinit_callback,
                                        NULL);

    /* Shut down workers */
    workerpool_deinit(wpool);

    return 0;
}

More examples could be found in the examples directory.

About

A pool of grunts to do the heavy lifting

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages