| Crates.io | vicinal |
| lib.rs | vicinal |
| version | 0.1.10 |
| created_at | 2025-12-27 06:24:38.825486+00 |
| updated_at | 2026-01-08 04:38:15.960508+00 |
| description | Processor-local worker pool that schedules tasks in the vicinity of the caller |
| homepage | |
| repository | https://github.com/folo-rs/folo |
| max_upload_size | |
| id | 2006760 |
| size | 119,394 |
Processor-local worker pool that schedules tasks in the vicinity of the caller.
This crate provides a worker pool where each task is executed on the same processor that spawned it, ensuring optimal cache locality and minimizing cross-processor data movement.
use vicinal::Pool;
#[tokio::main]
async fn main() {
let pool = Pool::new();
let scheduler = pool.scheduler();
let task1 = scheduler.spawn(|| 42);
let _task2 = scheduler.spawn(|| println!("doing some stuff"));
assert_eq!(task1.await, 42);
let scheduler2 = scheduler.clone();
let task3 = scheduler.spawn(move || scheduler2.spawn(|| 55));
assert_eq!(task3.await.await, 55);
}
The package is tested on the following operating systems:
On non-Windows non-Linux platforms (e.g. mac OS), the package will not uphold the processor locality guarantees, but will otherwise function correctly as a worker pool.
More details in the package documentation.
This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.