bama4 / simple-http-server

A simple lightweight HTTP server in C
0 stars 0 forks source link

Create Task Structure Library #7

Open bama4 opened 3 years ago

bama4 commented 3 years ago

Description This ticket involves implementing a task structure. The task library should be a separate folder under the utils top level directory.

This task library should be linked with all of the other util packages into one library called libutils.so. Depending on the design, the components may need to be split up into separate libraries.

The task takes a callback function, and void * function as its members.

Suggested layout:

typedef void * (*callback) (void *);

typedef  struct _task{
   callback a_task;
   void * arg;
} task;

Goal The task structure is created and its members include

bama4 commented 3 years ago

I am thinking about whether this should be implemented using the active object design pattern https://www.topcoder.com/thrive/articles/Concurrency%20Patterns%20-%20Active%20Object%20and%20Monitor%20Object

bama4 commented 3 years ago

https://nachtimwald.com/2019/04/12/thread-pool-in-c/

bama4 commented 3 years ago

Need to solve problem of controlling thread termination: