diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-06-17 14:24:51 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-06-17 14:24:51 -0400 |
| commit | 1ccb3c92a4c074a12550c584d3651ace2d7c0131 (patch) | |
| tree | 3288fc8f7b6bb9e31fe43cfbd3d5e18e61d0207e /docs/application | |
| parent | 7964cf08ac807ac9e7b6d579a25321a23adc9139 (diff) | |
qualifiers as %
Diffstat (limited to 'docs/application')
| -rw-r--r-- | docs/application/index.md | 4 | ||||
| -rw-r--r-- | docs/application/mutex.md | 3 | ||||
| -rw-r--r-- | docs/application/native.md | 2 | ||||
| -rw-r--r-- | docs/application/shared.md | 2 | ||||
| -rw-r--r-- | docs/application/thread.md | 9 |
5 files changed, 14 insertions, 6 deletions
diff --git a/docs/application/index.md b/docs/application/index.md index be3d621..b89d79f 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -36,7 +36,9 @@ ### Module -### String/REPL +### String + +### REPL 1. ##### Parse 2. ##### Scan diff --git a/docs/application/mutex.md b/docs/application/mutex.md index 999f5dc..e1b15c7 100644 --- a/docs/application/mutex.md +++ b/docs/application/mutex.md @@ -6,7 +6,7 @@ ```c typedef struct { - kpl_atomic_queue queue; + kpl_task_queue queue; _Atomic int32_t lock; } kpl_mutex; ``` @@ -20,4 +20,5 @@ typedef struct { ### Mutex Task 1. Get task from `queue` and run task + * Use spinlock with `pasue`, the `lock` will be set before the task is added to the `queue` 2. After task completion, do `value = --lock`, stop if `value` is `0`, otherwise repeat diff --git a/docs/application/native.md b/docs/application/native.md index 9d4b917..8cd8f82 100644 --- a/docs/application/native.md +++ b/docs/application/native.md @@ -2,6 +2,8 @@ --- +## Object Definitions + ```c typedef struct _kpl_native { KPL_SLAB_HEADER(_kpl_native); diff --git a/docs/application/shared.md b/docs/application/shared.md index 95616c9..88026f9 100644 --- a/docs/application/shared.md +++ b/docs/application/shared.md @@ -7,7 +7,7 @@ ```c typedef struct _kpl_shared { KPL_SLAB_HEADER(_kpl_shared); - void *data; + kpl_class data; kpl_mutex mutex; bool mark; } kpl_shared; diff --git a/docs/application/thread.md b/docs/application/thread.md index 231b0fe..2f85a67 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -9,12 +9,15 @@ typedef struct _kpl_task kpl_task; typedef void kpl_task_fn(kpl_task *t); +#define KPL_TASK_STATE_SIZE 32 + typedef struct _task { task *_Atomic next, *join; - kpl_group *state; + kpl_class state[KPL_TASK_STATE_SIZE]; kpl_result return_value; task_fn *fn; int32_t thread_id; + int16_t state_length; _Atomic bool join_ready; } task; @@ -35,10 +38,10 @@ typedef struct { struct { kpl_task *_Atomic next; } dummy; -} kpl_atomic_queue; +} kpl_task_queue; typedef struct { - kpl_atomic_queue queue; + kpl_task_queue queue; _Atomic ssize_t priority; kpl_task_slab *slab; kpl_task *pool; |
