From 20a19f433956f063d8048f032aaf5dcce1d61e7c Mon Sep 17 00:00:00 2001 From: nodist Date: Thu, 11 Jun 2026 12:08:10 -0400 Subject: add algo for mutating shared object --- docs/application/thread.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docs/application/thread.md') diff --git a/docs/application/thread.md b/docs/application/thread.md index fd5bb5d..95bd450 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -11,13 +11,12 @@ typedef void kpl_task_fn(kpl_task *t); typedef struct _kpl_task { POOL_HEADER(_kpl_task); - _Atomic bool join_ready; - uint16_t worker_id; + _Atomic bool next_ready; + uint16_t thread_id; kpl_task_fn *fn; kpl_group *state; kpl_interface *ret_interface; kpl_result ret; - _Atomic int32_t ref_count; } kpl_task; typedef struct { @@ -41,6 +40,10 @@ static pthread_cond_t async_cond; static kpl_thread threads[KPL_MAX_THREADS]; ``` +## Initialization + +On the start of each thread, set the cpu affinity to its thread id + ## Task State ```text -- cgit v1.2.3