diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-10-17 15:41:01 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-10-17 15:41:01 -0400 |
| commit | 801aeb9172136ca93a4603fcf8dcf8e19a1522fe (patch) | |
| tree | 3e55e80388c53188d042bb3ced3dad36c510abf9 /include/kpl/env.h | |
| parent | 6673bb9357b9ed8187f3dcb2917e2c6a9da25ee7 (diff) | |
add io_uring
Diffstat (limited to 'include/kpl/env.h')
| -rw-r--r-- | include/kpl/env.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/kpl/env.h b/include/kpl/env.h index f3ad721..7806969 100644 --- a/include/kpl/env.h +++ b/include/kpl/env.h @@ -12,7 +12,7 @@ typedef enum : int32_t { typedef struct _kpl_thread { int32_t thread_id; // self id kpl_memory_allocator memory_allocator; - // TODO io_uring + kpl_io_uring io_uring; // TODO jit allocator _Atomic ssize_t priority; // running + the total number of tasks in threads queue, lower is higher priority kpl_object_queue task_queue; @@ -39,12 +39,13 @@ inline void *kpl_thread_object_allocate(kpl_thread *thread, int32_t size) { * kpl_env_free &env */ typedef struct _kpl_env { + int32_t io_uring_queue_size_pow2; // the power of two to calculate the entries in the io_uring queue int32_t thread_count; // -1 updates this value to max possible, 0 invalid, >= 1 for specific number _Atomic ssize_t total_priority; // the sum of the threads priority fields, application stops on zero kpl_thread *threads; // 0 is main thread, >= 1 are spawned pthreads kpl_tree *namespace_tree, *module_tree; // *namespace_tree lookups are thread safe, *module_tree needs mutex pthread_mutex_t module_tree_mutex; -} kpl_env; // kpl state, no globals +} kpl_env; // kpl state, no globals, must be zero initialized /* * All objects are returned by this @@ -76,14 +77,14 @@ kpl_exit_code kpl_env_config(kpl_env *env, int32_t argc, char *argv[]); kpl_exit_code kpl_env_init(kpl_env *env); /* - * Can be run multiple times as long as new tasks are added after each run + * Run once, not re-enetrant + * TODO RUN TASK AND IO ORDERING */ kpl_exit_code kpl_env_run(kpl_env *env); /* * Stops KPL, can be called on any task in KPL * Does not return just signals to all threads to stop, the return status will be from kpl_env_run - * Start can be called again */ void kpl_env_stop(kpl_env *env); |
