raz / commit e45675ff

commit
e45675ff19bbe4f5e03ee929990c30e7178fce65
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
a5ac0162
Plan: buffered Out with an exit hook, native threads, link static

patch · log

1 file changed, +14 -2

PLAN.md (history) modified +14 -2

@@ -106,12 +106,24 @@
106106 library, the default for targets with no file of their own.
107107 Examples with `printf` to `stdout`, and an X11 window, reading
108108 `XEvent` as an array of words through pointer conversions.
109+ Ending a program: the entry point calls `Rt.exit(status)`, which
110+ runs the procedures registered with `Rt.atExit`, then ends it;
111+ `Rt.fail` runs them too. A buffered `lib/Out.jed`: 4 KB, flushed
112+ at each newline when standard output is a terminal, when full,
113+ by `Out.flush`, and at exit. The report says how to mix `Out`
114+ with C's `stdio`: flush one before using the other.
109115 - [ ] 12. `F32`: arithmetic, conversions, calls; real literals become
110116 untyped constants that take `F32` or `F64`.
111117 - [ ] 13. A thread-safe `lib/Heap.jed`: its bad sizes refused, and a
112118 marker in each block's header so that freeing a block twice, or
113- one it never gave out, stops the program. An example with
114- threads from `pthread_create`.
119+ one it never gave out, stops the program; `Out` locks its buffer.
120+ An example with threads from `pthread_create`.
121+ Native threads for programs without C, in
122+ `lib/Thread.linux-x86_64.jed`: `spawn` on an `mmap`ed stack with
123+ a guard page, through `clone` and a small code procedure; `join`
124+ and a `Mutex` through `futex`. `link static;` marks a module that
125+ needs a program without C; the compiler refuses a program that
126+ uses both.
115127 - [ ] 14. Line numbers for gdb: `.debug_line`, with the least of
116128 `.debug_info` and `.debug_abbrev` that gdb needs.
117129