summaryrefslogtreecommitdiff
path: root/docs/application/thread.md
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-06-11 12:08:10 -0400
committernodist <kevin.comas.git@gmail.com>2026-06-11 12:08:10 -0400
commit20a19f433956f063d8048f032aaf5dcce1d61e7c (patch)
treec9720211c62e75a245c252c82f6353e5162fcb86 /docs/application/thread.md
parent51d055dc7e1a6edbaedb7ea80b1e678eff924fe0 (diff)
add algo for mutating shared object
Diffstat (limited to 'docs/application/thread.md')
-rw-r--r--docs/application/thread.md9
1 files changed, 6 insertions, 3 deletions
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