The program threads
A demonstration of threads (docs/ARCHITECTURE.md, decision 6).
One program, one address space, five threads. Each square is drawn by its own thread, in a picture that the threads share with the first thread: the threads share all the memory. The first thread shows the pictures in the window. The same procedure runs in the four threads; only the parameter record differs. The kernel gives the processor to each thread in turn: no thread calls another.
Each thread computes with floating point numbers. The kernel keeps the registers of each thread: a wrong picture means a lost register.
1 to 4: stop the thread of a square, or start it again
| Fact | Value |
|---|---|
| Source | programs/threads |
| Boot image | in the boot image; the image is not built, so its size is not known |
| Imports | none |
| Imported by | none |
Exports
| Export | What it does |
|---|---|
| entry() |
Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | {} | Not named in grants_of: the grants of each other program. |
| Budget: pages, programs, threads | {pages = 2048, programs = 1, threads = 6} |
Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.
