diff options
Diffstat (limited to 'docs/application/thread.md')
| -rw-r--r-- | docs/application/thread.md | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/docs/application/thread.md b/docs/application/thread.md index 770358f..6d3f76f 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -22,13 +22,6 @@ typedef struct _task { _Atomic bool join_ready; } task; -#define KPL_TASK_SLAB_SIZE 50 - -typedef struct _kpl_task_slab { - struct _kpl_task_slab *next; - kpl_task array[KPL_TASK_SLAB_SIZE]; -} kpl_task_slab; - #define KPL_QUEUE_ASYNC -1 #define KPL_MAIN_THREAD 0 @@ -40,13 +33,11 @@ typedef struct { } dummy; } kpl_task_queue; +// TODO RING BUFFER ALLOCATOR + typedef struct { kpl_task_queue queue; _Atomic ssize_t priority; - uint32_t slab_array_index; - _Atomic uint32_t pool_size; - kpl_task_slab *slab; - kpl_task *pool; sem_t counter; pthread_t thread; } kpl_thread; @@ -75,12 +66,20 @@ regex : captures, function state, regex function ## Sync +Queue task on selected thread + ## Async +Queue task on thread with lowest `priority` + # Running ## Joining +# Thread Pool Management + +Run task to check thread pool sizes and create tasks to spread out a large pool across other threads + # Example ```c |
