modus
Menu
On this page

The entry requests_reader

The slow reader of the test of fan-out and the pace . The test module requests_pace starts it, then starts server with a wiring list whose rows wire server.requests to each record input of this process, each with a ring of PACE_RING_CAPACITY compartments:

  • held, of the pace Always_Holds_Writer: a full ring holds the server;
  • gapped, of the pace Never_Holds_Writer: a full ring refuses the record for this reader alone, which then reads a gap record.

It reads in three phases, each opened by a state of its rings and never by a time. The tool sends the requests in three parts: C, then C after the line "phase 1 read", then the rest after "phase 2 read". So no request is in flight while this reader drains a ring, and the counts are exact by construction:

  1. 1. It reads nothing until held is full and the server waits for room in it. Both rings then hold the joined record of 0 and the records 0 to capacity - 2. It reads held whole: the server goes on, and gapped, still full, refuses each next record.
  2. 2. It reads nothing until held is full again and the server waits: the records capacity - 1 to 2 capacity - 2 are in held, and gapped refused each of them. It reads gapped whole, then held whole.
  3. 3. The server writes the next record: gapped takes first a gap record of exactly capacity records from the serial capacity - 1, then the record. Both rings hold the rest of the stream, which ends when the asker stops the server. It reads each ring to its end word.

Start: by requests_pace only. What a reader sees: no window; one line for each record input "requests_reader: ...: as it must", or a line "requests_reader: WRONG: ...". It stops itself with the outcome Done, or Failed after a WRONG line.

See: Record outputs and record inputs of a module: typed streams of records between processes: Fan-out and flow control in the repository

requests_reader module with an entry

Hash
0b3442a261b2da79a21d05dd3f7176e762e2ed91c43c5a2aaf052853f4426ef1
Size
65536 bytes
Exports
0
Imports
0
Imported by
0
License
MIT

The slow reader of the test of fan-out and the pace

FactValue
KindModules with an entry
Sourcesrc/modules/tests/requests_reader
Boot imageyes: in the boot image, 65536 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/tests/requests_reader/main.odin:144

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
GrantsnoneIts slow reader: its two ends come in its wiring ring before the first instruction of server, and it needs 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).

requests global variable of the package server

requests: system.Record_Output(Access_Record)

One request that the server answered.

src/modules/demonstrations/server/requests.odin:35