Crate pingora_runtime

source ·
Expand description

Pingora tokio runtime.

Tokio runtime comes in two flavors: a single-threaded runtime and a multi-threaded one which provides work stealing. Benchmark shows that, compared to the single-threaded runtime, the multi-threaded one has some overhead due to its more sophisticated work steal scheduling.

This crate provides a third flavor: a multi-threaded runtime without work stealing. This flavor is as efficient as the single-threaded runtime while allows the async program to use multiple cores.

Structs§

  • Multi-threaded runtime backed by a pool of single threaded tokio runtime

Enums§

  • Pingora async multi-threaded runtime

Functions§

  • Return the Handle of current runtime. If the current thread is under a Steal runtime, the current Handle is returned. If the current thread is under a NoSteal runtime, the Handle of a random thread under this runtime is returned. This function will panic if called outside any runtime.