summaryrefslogtreecommitdiff
path: root/docs/application
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-06-16 12:42:41 -0400
committernodist <kevin.comas.git@gmail.com>2026-06-16 12:42:41 -0400
commit7964cf08ac807ac9e7b6d579a25321a23adc9139 (patch)
tree807799f7c4dea85fca31e3532b0e06f71f0f32ea /docs/application
parente99f60fe8cdef48aad9aa6a1b360b600443ac659 (diff)
new layout by dependecy graph
Diffstat (limited to 'docs/application')
-rw-r--r--docs/application/index.md9
-rw-r--r--docs/application/memory.md10
-rw-r--r--docs/application/mutex.md23
-rw-r--r--docs/application/namespace.md2
-rw-r--r--docs/application/shared.md14
5 files changed, 35 insertions, 23 deletions
diff --git a/docs/application/index.md b/docs/application/index.md
index 21ca20f..be3d621 100644
--- a/docs/application/index.md
+++ b/docs/application/index.md
@@ -11,20 +11,21 @@
# Sections
* ##### [Interface](./interface.md)
-* ##### [Type](./type.md)
-* ##### [Memory](./memory.md)
-# ##### [Name](./name.md)
* ##### [Thread](./thread.md)
+* ##### [Mutex](./mutex.md)
+* ##### [Memory](./memory.md)
* ##### [Io](./io.md)
+* ##### [Name](./name.md)
* ##### [Shared](./shared.md)
+* ##### [Type](./type.md)
* ##### [Group](./group.md)
* ##### [Buffer](./buffer.md)
* ##### [Map](./map.md)
* ##### [Queue](./queue.md)
* ##### [Union](./union.md)
* ##### [Native](./native.md)
-* ##### [Error](./error.md)
* ##### [Namespace](./namespace.md)
+* ##### [Error](./error.md)
* ##### [Testing](./testing.md)
# Invocation
diff --git a/docs/application/memory.md b/docs/application/memory.md
index 2689b62..eda866f 100644
--- a/docs/application/memory.md
+++ b/docs/application/memory.md
@@ -20,9 +20,9 @@ typedef struct _kpl_slab {
typedef struct {
uint32_t object_size, array_size;
_Atomic size_t slab_length;
- kpl_slab *root;
- kpl_slab_obj *pool;
- pthread_mutex_t slab_pool_mutex;
+ kpl_slab *slab;
+ kpl_slab_obj *head;
+ kpl_mutex mutex;
} kpl_slab;
#define KPL_POOL_HEADER(STRUCT) KPL_SLAB_HEADER(STRUCT); uint32_t obj_byte_size
@@ -34,8 +34,8 @@ typedef struct _kpl_pool_obj {
typedef strut {
uint32_t min_obj_size;
_Atomic size_t alloc_byte_size;
- kpl_pool_obj *root;
- pthread_mutex_t root_mutex;
+ kpl_pool_obj *head;
+ kpl_mutex mutex;
} kpl_pool;
```
diff --git a/docs/application/mutex.md b/docs/application/mutex.md
new file mode 100644
index 0000000..999f5dc
--- /dev/null
+++ b/docs/application/mutex.md
@@ -0,0 +1,23 @@
+# Mutex
+
+---
+
+## Object Definitions
+
+```c
+typedef struct {
+ kpl_atomic_queue queue;
+ _Atomic int32_t lock;
+} kpl_mutex;
+```
+
+## Usage
+
+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 mutex task, otherwise the thread moves on
+
+### Mutex Task
+
+1. Get task from `queue` and run task
+2. After task completion, do `value = --lock`, stop if `value` is `0`, otherwise repeat
diff --git a/docs/application/namespace.md b/docs/application/namespace.md
index 96d9045..ab38d3f 100644
--- a/docs/application/namespace.md
+++ b/docs/application/namespace.md
@@ -20,11 +20,11 @@ static kpl_namespace_native *namespace_native_head;
typedef struct _kpl_namespace_module {
SLAB_HEADER(_kpl_namespace_module);
- kpl_type_ptr ast;
kpl_queue *parents;
kpl_buffer *module_name, *module_string;
kpl_export *exports;
kpl_task *task;
+ kpl_type_ptr ast;
_Atomic int32_t children;
} kpl_namespace_module;
diff --git a/docs/application/shared.md b/docs/application/shared.md
index b2760c5..95616c9 100644
--- a/docs/application/shared.md
+++ b/docs/application/shared.md
@@ -8,21 +8,9 @@
typedef struct _kpl_shared {
KPL_SLAB_HEADER(_kpl_shared);
void *data;
- kpl_atomic_queue queue;
- _Atomic uint32_t lock;
+ kpl_mutex mutex;
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