Skip to content
workers

workers

Mojo module 🡭

workers

Helpers for splitting parallel passes into row bands, and the one place the library runs a band as a task.

run_bands is the only caller of TaskGroup in canvas/, so the private std.runtime._asyncrt import lives here alone in the library (#472; the roofline benchmarks import it too, to price the runtime itself), and so do the two rules that make banding safe: what a task borrows must outlive the wait (#263), and no heap-owning aggregate may cross create_task by value, since the runtime delivers it corrupted (#97). A band is a closure that captures its context by reference and takes only the band index, so nothing aggregate crosses the task boundary; the #97 reproducer rewritten that way is clean where the by-value form corrupts or crashes, on Mojo 1.1 as on 1.0.

Functions