The program rings
A demonstration of communication between programs (properties 2, 4, 6).
Each square is a program with its own address space. Each line between two squares is a ring: two pages of shared memory. A small colored square is a record. A node takes a record from the ring before it, works on it for some time, and puts it in the ring after it. No record goes through the kernel: the kernel only wakes a program that waits.
This program starts the nodes and gives each one its rings. It maps the same rings, so the picture is the real content of the queues.
left button on a node, or a: add a record
right button on a node, or 1 to 6: stop the program, or start it again
A stopped node takes no record: the records wait in the ring before it. A ring holds 32 records. When it is full, the node before keeps its record and waits.
| Fact | Value |
|---|---|
| Source | programs/rings |
| 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 | {.Image} | It starts its nodes from the boot image. |
| Budget: pages, programs, threads | {pages = 4096, programs = 7, threads = 7} | 6 nodes. |
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.
