modus
Menu

The program crowd

A measure of the shared queue and of the event.

Several threads write records in one queue as fast as they can, and several threads read them, for one second. The shared queue has no lock: a thread takes its place with one compare-and-exchange. The last measure uses a queue with one lock, for comparison.

The threads of each measure wait on one event. The first thread wakes the event one time: all of them start together.

Each record has the number of its writer and a count. A reader checks that the counts of each writer increase. At the end, the records that the readers took are the records that the writers wrote: no record is lost, and no record arrives two times.

FactValue
Sourceprograms/crowd
Boot imagein the boot image; the image is not built, so its size is not known
Importsnone
Imported bynone

Exports

ExportWhat 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

WhatValueAs the root service says
Grants{.Inspect}
Budget: pages, programs, threads{pages = 2048, programs = 1, threads = 5}

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.