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§
- NoSteal
Runtime - Multi-threaded runtime backed by a pool of single threaded tokio runtime
Enums§
- Runtime
- Pingora async multi-threaded runtime
Functions§
- current_
handle - 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 aNoSteal
runtime, the Handle of a random thread under this runtime is returned. This function will panic if called outside any runtime.