Skip to main content

Crate dtact

Crate dtact 

Source
Expand description

§Dtact-V3: Distributed Task-Aware Coroutine Toolkit

Dtact is a high-performance, low-latency asynchronous runtime designed for systems-level programming across heterogeneous architectures (x86_64, AArch64, RISC-V).

§Core Architecture

  1. Lock-Free Arena: A page-aligned memory pool for fiber contexts, providing O(1) allocation and hardware-level guard pages for memory safety.
  2. P2P Scheduler Mesh: A distributed work-stealing/deflection scheduler that minimizes L3 cache thrashing and maximizes NUMA-local execution.
  3. Zero-Copy Migration: Leveraging self-referential futures and direct stack-top injection to move running tasks across cores without heap allocation.

Dtact provides tiered safety levels (0-2) allowing developers to trade off between raw performance and hardware-enforced isolation (e.g., guard pages and SEH registration).

Structs§

dtact_handle_t
Handle for C-compatible FFI. Opaque handle representing a spawned Dtact fiber.

Enums§

DtactError
Runtime error types. Errors encountered during Dtact Runtime operation.

Functions§

cldemote
Hardware-level demotion API. Hardware-Assisted Optimization: Proactively push data to L3 cache
dtact_await
Wait for a fiber to complete. Blocks the current thread until the specified fiber terminates.
set_deflection_threshold
Set the deflection threshold for the DTA-V3 Scheduler. Sets the work-deflection threshold for a specific hardware worker.
spawn
Spawn a fiber. Spawns a new fiber and returns a handle for synchronization.
spawn_with_stack
Spawn a fiber with a custom stack size. Spawns a fiber from a closure with a specific stack configuration.
uintr_signal
Hardware-level interrupt signaling API. User-mode interrupt wakeup signal
wait
Wait for a fiber to complete. The core execution bridge between Rust Futures and Dtact Fibers.
yield_now
Yield execution to the scheduler. Yields execution to the scheduler.
yield_to
Yield execution to another fiber. Yields execution to another fiber handle asynchronously.

Attribute Macros§

dtact_init
Attribute macro for initializing the Dtact runtime.
export_async
Attribute macro for exporting an async function to C.
export_fiber
Attribute macro for exporting a fiber to C.
task
Attribute macro for defining a Dtact task.