Skip to main content
Async tasks overlap waiting work. CPU-heavy work needs real parallelism. Use sifr.parallel when a map over owned data would otherwise block the async runtime.

When to Use Parallel Work

Sifr rejects blocking or CPU-heavy calls that sit directly inside async code, because they prevent other tasks from making progress.

Parallel Map

map preserves output order. Inputs and outputs must be owned and sendable across the worker boundary.
Use try_map when each item can fail independently and you want typed per-item outcomes:

Worker Pools

For repeated parallel work in a long-lived process, configure a Pool explicitly:
Lock guards, task handles, and borrowed values cannot cross the worker boundary. Pass owned data in, and receive owned results back.

Async Concurrency vs Parallelism

  • Use Structured Tasks to run many async operations together.
  • Use sifr.parallel to speed up CPU-bound transforms.
  • Keep mutable borrows and lock guards out of both paths; see Ownership Across Tasks.

Next Steps

Concurrency API

Full sifr.parallel, sifr.task, and sifr.sync reference.

Async and Await

Review suspension points and why blocking work is rejected.