modus
Menu
On this page

The entry wired_reader

The reader of a pair of modules that the start list wires together. The design: Record outputs and record inputs of a module: typed streams of records between processes: The wiring rows of a start list in the repository. The default start list starts this module before wired_writer, whose start carries the wiring row of wired_writer.numbers to numbers.

It waits for its writer, then reads the joined record of 0, the NUMBERS_WRITTEN numbers in order, each with its square, and a clean end record, and stops itself with Done. A joined record past 0 says that the writer ran before its reader: the start list wired the pair in the wrong order.

Start: by the default start policy. What a reader sees: no window; one line "wired_reader: read the joined record of 0, the 16 numbers of wired_writer in order, and a clean end: ...". With no writer within the hang bound, the fact "wired_reader: no writer came ..." and the stop Done. A record that breaks the order gives a line "wired_reader: WRONG: ..." and the stop Failed.

wired_reader module with an entry

Hash
41c835fea2eae22bad1943bc63aa46b60f410631c254c36bffc58120fca38407
Size
53248 bytes
Exports
0
Imports
0
Imported by
0
License
MIT

The reader of a pair of modules that the start list wires together

FactValue
KindModules with an entry
Sourcesrc/modules/demonstrations/wired_reader
Boot imageyes: in the boot image, 53248 bytes in this build
Build settingsnone: the defaults of the source
Importsnone
Imported bynone

Neighbours

It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.

Exports

ExportWhat it does
entry()

entry

entry()
Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/demonstrations/wired_reader/main.odin:42

Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).

What the root service gives it

WhatValueAs the root service says
GrantsnoneThe demonstration pair of the start list: the start policy wires them, and they need no grant.
Other terms of its start grant setnone
Budget that it asks for
  • the least budget
No MODULE_BUDGET in its source: it asks for the least budget.

The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module; the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).

numbers global variable of the package wired_writer

numbers: system.Record_Output(Wired_Number)

Each number from 0, and its square.

src/modules/demonstrations/wired_writer/main.odin:32