diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-06-15 21:19:41 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-06-15 21:19:41 -0400 |
| commit | e99f60fe8cdef48aad9aa6a1b360b600443ac659 (patch) | |
| tree | 49dcfe048e5a93360bbde2cabb54c708c80cf5a4 /docs/application | |
| parent | 47a27b0fd6eb0831a74479883ba0b4c30d226fbe (diff) | |
add shared mutating algo
Diffstat (limited to 'docs/application')
| -rw-r--r-- | docs/application/interface.md | 2 | ||||
| -rw-r--r-- | docs/application/io.md | 4 | ||||
| -rw-r--r-- | docs/application/memory.md | 4 | ||||
| -rw-r--r-- | docs/application/shared.md | 15 |
4 files changed, 22 insertions, 3 deletions
diff --git a/docs/application/interface.md b/docs/application/interface.md index da4f4bb..8a5dc69 100644 --- a/docs/application/interface.md +++ b/docs/application/interface.md @@ -28,8 +28,6 @@ typedef bool kpl_any_eq_fn(const kpl_any a, const kpl_any b); typedef ssize_t kpl_any_cmp_fn(const kpl_any a, const kpl_any b); -typedef void kpl_any_gc_mark(kpl_any a); - typedef void kpl_any_free_fn(kpl_any a); // TODO write diff --git a/docs/application/io.md b/docs/application/io.md index 9ab786c..010c70a 100644 --- a/docs/application/io.md +++ b/docs/application/io.md @@ -3,3 +3,7 @@ --- All Io is done through linux io uring + +# Networking + +## kTLS diff --git a/docs/application/memory.md b/docs/application/memory.md index 8340141..2689b62 100644 --- a/docs/application/memory.md +++ b/docs/application/memory.md @@ -45,6 +45,10 @@ The max size of an object in the pool is 2 \*\* 32 This allows for 4 aligned bytes after the `POOL_HEADER` macro +## Slab Leak Detection + +On debug builds before each slab is freed, all items removed from the slab should be found on the slabs pool + ## List Management ## Tree Management diff --git a/docs/application/shared.md b/docs/application/shared.md index bed94d2..b2760c5 100644 --- a/docs/application/shared.md +++ b/docs/application/shared.md @@ -9,7 +9,20 @@ typedef struct _kpl_shared { KPL_SLAB_HEADER(_kpl_shared); void *data; kpl_atomic_queue queue; - _Atomic bool mutating; + _Atomic uint32_t lock; bool mark; } kpl_shared; ``` + +## Mutating + +1. Before adding to the `queue` do `value = lock++` +2. Add to the queue +3. If `value` is `0` the thread does an async schedule of the mutator task, otherwise the thread moves on + +### Mutator Task + +1. Get task from `queue` and run task +2. After task completion, do `value = --lock`, stop if `value` is `0`, otherwise repeat + +## Garbage Collection |
