diff options
| author | tylov <[email protected]> | 2023-07-20 14:42:00 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-20 15:00:02 +0200 |
| commit | 224a04f7fa7549ed94d2a1415eb25829e39a7cca (patch) | |
| tree | 1d1be262be71b512d334ded99741a64f2aa6ca67 /docs | |
| parent | 313c1d7bb9b92e75801429c1f7f132589860292e (diff) | |
| download | STC-modified-224a04f7fa7549ed94d2a1415eb25829e39a7cca.tar.gz STC-modified-224a04f7fa7549ed94d2a1415eb25829e39a7cca.zip | |
Added Task-object to coroutines and true stackless execution.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ccommon_api.md | 5 | ||||
| -rw-r--r-- | docs/cspan_api.md | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index e053f743..1e1ae1aa 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -390,7 +390,10 @@ cco_routine scope; Use `if-else-if` constructs instead. | | `cco_await_v(condition, ret);` | Suspend until condition is true (return ret)| | | `cco_await_on(cocall);` | Await on sub-coroutine to finish (return its ret) | | | `cco_return;` | Return from coroutine (inside cco_routine) | -| | `cco_closure(Closure, ...);` | Define a coroutine closure struct (optional) | +| | Task objects: | | +| | `cco_task_struct(Name, ...);` | Define a coroutine task struct | +| | `cco_await_task(task, ...);` | Await for task to finish or optionally yield a value | +| | `cco_block_task(task);` | Run blocking until task is finished (stackless) | | | Semaphores: | | | | `cco_sem` | Semaphore type | | `cco_sem` | `cco_sem_from(long value)` | Create semaphore | diff --git a/docs/cspan_api.md b/docs/cspan_api.md index 09821450..e1c92bbf 100644 --- a/docs/cspan_api.md +++ b/docs/cspan_api.md @@ -26,14 +26,14 @@ i.e., it may be expanded multiple times. However, all index arguments are safe, `cspan_at(&ms3, i++, j++, k++)` is allowed. If the number of arguments does not match the span rank, a compile error is issued. Runtime bounds checks are enabled by default (define `STC_NDEBUG` or `NDEBUG` to disable). ```c -SpanType cspan_init(T SpanType, {v1, v2, ...}); // make a 1-d cspan from values -SpanType cspan_from(STCContainer* cnt); // make a 1-d cspan from compatible STC container -SpanType cspan_from_array(ValueType array[]); // make a 1-d cspan from C array - +SpanType cspan_init(TYPE SpanType, {v1, v2, ...}); // make a 1-d cspan from values +SpanType cspan_from(STCContainer* cnt); // make a 1-d cspan from a cvec, cstack, cpque (heap) +SpanType cspan_from_array(ValueType array[]); // make a 1-d cspan from a C array + intptr_t cspan_size(const SpanTypeN* self); // return number of elements intptr_t cspan_rank(const SpanTypeN* self); // dimensions; compile time constant intptr_t cspan_index(const SpanTypeN* self, intptr_t x, ..); // index of element - + ValueType* cspan_at(const SpanTypeN* self, intptr_t x, ...); // #args must match input span rank ValueType* cspan_front(const SpanTypeN* self); ValueType* cspan_back(const SpanTypeN* self); @@ -55,13 +55,13 @@ SpanType2 cspan_subspan2(const SpanType2* span, intptr_t offset, intptr_t SpanType3 cspan_subspan3(const SpanType3* span, intptr_t offset, intptr_t count); // create a sub md span of lower rank. Like e.g. cspan_slice(Span2, &ms4, {x}, {y}, {c_ALL}, {c_ALL}); -OutSpan1 cspan_submd2(const SpanType2* parent, intptr_t x); // return a 1d subspan from a 2d span. +OutSpan cspan_submd2(const SpanType2* parent, intptr_t x); // return a 1d subspan from a 2d span. OutSpanN cspan_submd3(const SpanType3* parent, intptr_t x, ...); // return a 1d or 2d subspan from a 3d span. OutSpanN cspan_submd4(const SpanType4* parent, intptr_t x, ...); // number of args decides rank of output span. // general slicing of an md span. // {i}: reduce rank. {i,c_END}: slice to end. {c_ALL}: use full extent. -OutSpanN cspan_slice(TYPE OutSpanN, const SpanTypeN* parent, {x0,x1}, {y0,y1}.., {N0,N1}); +OutSpanN cspan_slice(TYPE OutSpanN, const SpanTypeM* parent, {x0,x1}, {y0,y1}.., {N0,N1}); ``` ## TypesPd | Type name | Type definition / usage | Used to represent... | |
