diff options
Diffstat (limited to 'docs/application')
| -rw-r--r-- | docs/application/index.md | 29 | ||||
| -rw-r--r-- | docs/application/interface.md | 8 | ||||
| -rw-r--r-- | docs/application/namespace.md | 13 | ||||
| -rw-r--r-- | docs/application/thread.md | 16 |
4 files changed, 48 insertions, 18 deletions
diff --git a/docs/application/index.md b/docs/application/index.md index 3809ac9..e7e719f 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -2,22 +2,41 @@ --- -## Requirements +# Requirements * Linux X64 * GNU Make * GCC with -std=gnu99 -fhardened -## Sections +# Sections * ##### [Interface](./interface.md) * ##### [Type](./type.md) * ##### [Pool](./pool.md) * ##### [Thread](./thread.md) +* ##### [Namespace](./namespace.md) * ##### [Testing](./testing.md) -## Invocation +# Invocation -### File +## Startup -### REPL +```c +void kpl_init(void); +``` + +## Main + +```c +void kpl_main(int argc, char *argv[]); +``` + +## File + +## REPL + +## Shutdown + +```c +void kpl_free(void) +``` diff --git a/docs/application/interface.md b/docs/application/interface.md index 1493aff..3f270bd 100644 --- a/docs/application/interface.md +++ b/docs/application/interface.md @@ -33,14 +33,6 @@ typedef int32_t kpl_any_print_fn(const kpl_any a, FILE *file, size_t idnt, uint3 typedef void kpl_any_free_fn(kpl_any a); typedef struct { - kpl_any_hash_fn *hash_fn; - kpl_any_eq_fn *eq_fn; - kpl_any_cmp_fn *cmp_fn; - kpl_any_print_fn *print_fn; - kpl_any_free_fn *free_fn; -} kpl_any_interace; - -typedef struct { any value, info; } kpl_result; ``` diff --git a/docs/application/namespace.md b/docs/application/namespace.md new file mode 100644 index 0000000..47f6105 --- /dev/null +++ b/docs/application/namespace.md @@ -0,0 +1,13 @@ +# Namespace + +--- + +## Object Definitions + +# Native Registering + +# File Registering + +## Import + +## Export diff --git a/docs/application/thread.md b/docs/application/thread.md index 04d9c98..a11c01f 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -23,15 +23,21 @@ typedef struct _kpl_task { } kpl_task; typedef struct { - kpl_task *head, *tail; + kpl_task *queue_head, *queue_tail; pthread_t thread; } kpl_thread; -#define KPL_PROCESSES $(nproc) +#define KPL_THREADS $(nproc) -kpl_thread kpl_worker[KPL_PROCESSES] = {}; +_Atomic uint16_t running; // init to KPL_THREADS -_Atomic uint16_t kpl_worker_running = KPL_PROCESSES; +kpl_task *async_queue_head, *async_queue_tail; + +pthread_mutex_t async_mutex; + +pthread_cond_t async_cond; + +kpl_thread threads[KPL_THREADS]; ``` ## Per Process Task Queue @@ -236,7 +242,7 @@ fib : Fn[n] $ ( n < 2 { 1 } { + (fib `sync n - 1; fib `sync n - 2) } } - v : Vector[`fork_type fib] $ () + v : Array[`fork_type fib] $ () @ 1 .. I { v `push fib `async FIB } @ v {[fib_task] `print "fib(%) = %\n" `format (FIB; `wait fib_task) } `print "Complete\n" |
