diff options
Diffstat (limited to 'docs/application')
| -rw-r--r-- | docs/application/buffer.md | 7 | ||||
| -rw-r--r-- | docs/application/index.md | 20 | ||||
| -rw-r--r-- | docs/application/interface.md | 4 | ||||
| -rw-r--r-- | docs/application/memory.md | 6 | ||||
| -rw-r--r-- | docs/application/namespace.md | 3 | ||||
| -rw-r--r-- | docs/application/shared.md | 3 | ||||
| -rw-r--r-- | docs/application/testing.md | 8 | ||||
| -rw-r--r-- | docs/application/thread.md | 7 |
8 files changed, 36 insertions, 22 deletions
diff --git a/docs/application/buffer.md b/docs/application/buffer.md index ea30458..92de6ae 100644 --- a/docs/application/buffer.md +++ b/docs/application/buffer.md @@ -7,10 +7,15 @@ ```c typedef struct _kpl_buffer { KPL_ALLOC_HEADER(struct _kpl_buffer); - size_t byte_length; + size_t byte_length : KPL_ALLOC_POOL_SIZE; + int32_t io_register_index : KPL_ALLOC_WEIGHT; kpl_interface *interface; uint8_t bytes[]; } kpl_buffer; ``` +## Io uring buffer register + +### Set `io_register_index` to -1 of not used + ## Unicode Methods diff --git a/docs/application/index.md b/docs/application/index.md index d99b941..40a03b8 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -2,13 +2,13 @@ --- -# Requirements +## Requirements * Linux X64 with io_uring (6+) * GNU Make * GCC with -std=gnu99 -fhardened (14+) -# Sections +## Sections * ##### [Interface](./interface.md) * ##### [Thread](./thread.md) @@ -34,8 +34,8 @@ 1. Configuration 2. Initialize tasks -3. Initialize types -4. Initialize allocators +2. Initialize allocators +4. Initialize types 5. Initialize IO ## Main @@ -48,10 +48,10 @@ 1. ##### [Register](../lifecycle/register.md) 2. ##### [Parse](../lifecycle/parse.md) -3. ##### Scope -4. ##### Import -5. ##### Check -6. ##### Eval +3. ##### [Scope](../lifecycle/scope.md) +4. ##### [Import](../lifecycle/import.md) +5. ##### [Check](../lifecycle/check.md) +6. ##### [Eval](../lifecycle/eval.md) 7. ##### Ir 8. ##### Jit 9. ##### Exec @@ -60,6 +60,6 @@ ## Shutdown 1. Clean up IO -2. Clean up allocators -3. Clean up types +2. Clean up types +3. Clean up allocators 4. Clean up tasks diff --git a/docs/application/interface.md b/docs/application/interface.md index 887f7f7..790c155 100644 --- a/docs/application/interface.md +++ b/docs/application/interface.md @@ -45,11 +45,11 @@ typedef enum : uint8_t { KPL_STATUS_ERROR, KPL_STATUS_NULL, KPL_STATUS_VALUE -} kpl_status; +} kpl_result_status; typedef struct { any value; - kpl_status status; + kpl_result_status status; } kpl_result; kpl_result kpl_result_error(error *er); diff --git a/docs/application/memory.md b/docs/application/memory.md index a8e75b8..e7f05ba 100644 --- a/docs/application/memory.md +++ b/docs/application/memory.md @@ -7,9 +7,9 @@ ```c #define KPL_ALLOC_POOL_SIZE 40 -#define KPL_TREE_WEIGHT 24 +#define KPL_ALLOC_WEIGHT 24 -#define KPL_ALLOC_HEADER(STRCUT) size_t obj_size : KPL_ALLOC_POOL_SIZE; uint32_t tree_weight : KPL_TREE_WEIGHT; STRCUT *prev +#define KPL_ALLOC_HEADER(STRCUT) size_t obj_size : KPL_ALLOC_POOL_SIZE; uint32_t tree_weight : KPL_ALLOC_WEIGHT; STRCUT *prev typedef struct _kpl_alloc_obj { KPL_ALLOC_HEADER(_kpl_alloc_obj); @@ -39,7 +39,7 @@ typdef strcut _kpl_slab_list_obj { KPL_SLAB_LIST_HEADER(strcut _kpl_slab_list_obj); } kpl_slab_list_obj; -#define KPL_SLAB_TREE_HEADER(STRUCT) STRUCT *prev, *next; uin32_t tree_weight : KPL_TREE_WEIGHT +#define KPL_SLAB_TREE_HEADER(STRUCT) STRUCT *prev, *next; uint32_t tree_weight : KPL_ALLOC_WEIGHT typdef strcut _kpl_slab_tree_obj { KPL_SLAB_TREE_HEADER(struct _kpl_slab_tree_obj); diff --git a/docs/application/namespace.md b/docs/application/namespace.md index 38752ce..c6b8cea 100644 --- a/docs/application/namespace.md +++ b/docs/application/namespace.md @@ -26,7 +26,6 @@ typedef struct _kpl_namespace_module { KPL_SLAB_TREE_HEADER(struct _kpl_namespace_module); kpl_type_ptr ast; kpl_buffer *module_string, *module_name; - kpl_task *_Atomic task; kpl_export *export_tree; kpl_mutex export_mutex; } kpl_namespace_module; @@ -92,5 +91,5 @@ Since the native modules are loaded statically the `native_module_tree` becomes 1. Add find namespace task to the `namespace_module_mutex`, the namespace not existing is an error 2. Add a get export task to the namespaces `export_mutex` -3. The `export_mutex` will not start processing it's queue until the `task` field is `NULL` +3. The `export_mutex` will not start processing it's queue until the namespace notifies that it's and unlocks its `export_mutex` 4. The importer will get a copy of the read only `export_tree` diff --git a/docs/application/shared.md b/docs/application/shared.md index 3a3f4f7..89ba292 100644 --- a/docs/application/shared.md +++ b/docs/application/shared.md @@ -24,7 +24,8 @@ static kpl_mutex shared_head_mutex; ## Initiation Task 1. Move `shared_head` to `shared_mark_head` -2. Add a mark task to each of the threads +2. Set `shared_threads_makred` to 0 +3. Add a mark task to each of the threads ## Mark Task(s) diff --git a/docs/application/testing.md b/docs/application/testing.md index 2964fae..710915c 100644 --- a/docs/application/testing.md +++ b/docs/application/testing.md @@ -42,3 +42,11 @@ typedef struct { // TODO FAIL ``` + +## `make test` + +Bundle all tests into a single executable + +## `TEST_FILES="$NAMES..." make test` + +Only build specified file(s) diff --git a/docs/application/thread.md b/docs/application/thread.md index 7ed5cae..770358f 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -9,10 +9,10 @@ typedef struct _kpl_task kpl_task; typedef void kpl_task_fn(kpl_task *t); -#define KPL_TASK_STATE_SIZE 32 +#define KPL_TASK_STATE_SIZE 24 typedef struct _task { - task *_Atomic next, *join; + task *_Atomic next, *join, *parent; kpl_class state[KPL_TASK_STATE_SIZE]; kpl_result result; task_fn *fn; @@ -43,7 +43,8 @@ typedef struct { typedef struct { kpl_task_queue queue; _Atomic ssize_t priority; - size_t slab_array_index; + uint32_t slab_array_index; + _Atomic uint32_t pool_size; kpl_task_slab *slab; kpl_task *pool; sem_t counter; |
