momo-rs-core 0.1.0

Core task scheduling and executor for the Momo runtime.
Documentation

Momo (Core Execution Engine)

The core task scheduling and execution logic for the Momo runtime.

This module implements the internal event loop and task model that powers the entire Momo ecosystem. While users typically interact with these APIs via the umbrella momo crate, this module defines the fundamental rules of execution.

Execution Philosophy

Momo is built on the principle of Thread-Local Affinity. Unlike multi-threaded runtimes that use work-stealing, Momo pins every task to the thread that spawned it. This allows the runtime to be completely atomic-free in its hot paths, providing superior performance and cache locality for single-threaded or performance-critical workloads.

Core Primitives

  • The Scheduler: A cooperative batch-based scheduler that processes tasks in 128-poll windows to ensure system responsiveness.
  • Injection Queues: A mechanism for tasks to be safely awakened by remote threads and integrated into the local execution flow.
  • Lifecycle Management: Tools for starting, stopping, and yielding execution within a task.

Usage Example (via momo-rs)

#[momo::main]
async fn main() {
    // Spawning a task in the momo-rs core
    momo::spawn(async {
        println!("Running on the Momo core scheduler.");
    });
}