Skip to main content
Sifr’s concurrency model is structured: every task belongs to an explicit scope, and the scope cannot exit until its children have finished or been cancelled. There are no fire-and-forget tasks, no global event-loop object, and no hidden task registry. The compiler applies the same safety model at concurrency boundaries that it applies everywhere else. Values crossing task, thread, or process boundaries must be owned and sendable. Mutable borrows and lock guards stay scoped.

Read This Section In Order

Async and Await

Define async functions, await suspension points, and understand how Sifr differs from Python asyncio.

Structured Tasks

Use scopes, spawned tasks, gather, select, and TaskGroup.

Cancellation and Timeouts

Bound work, observe cancellation evidence, and rely on cleanup before cancellation is surfaced.

Ownership Across Tasks

Learn what can cross task boundaries and why borrowed values cannot escape.

Parallel Work

Offload CPU-heavy maps and worker pools with sifr.parallel.

Concurrency API

Reference for sifr.task, sifr.sync, sifr.parallel, process helpers, signals, and cleanup.

What Is Different From Python

Python asyncio exposes event loops, detached tasks, and ambient task registries. Sifr does not. Sifr makes the lifetime of concurrent work part of the source program.

Ownership and Mutability

Review mut, own, own mut, and borrowed-value escape rules.

Error Handling

See how async functions report typed errors with Result.

Networking

Use async TCP, HTTP, TLS, and URL helpers.

Error Codes

Look up SIFR-ASYNC-* and task-boundary ownership diagnostics.