IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

runtime

Runtime services: runtime initialization and worker-thread queries.

This package exposes initialize_runtime(), for initializing the runtime explicitly when Mojo code built as a shared library is called from a non-Mojo host program, and parallelism_level(), for querying how many worker threads the runtime has available.

The async task primitives that back parallelize() and friends live in the private _asyncrt module. Mojo's async and coroutine support is unfinished and carries no stability guarantees, so it is deliberately not part of this package's public API. Do not build async patterns on it yet.

Functions