Skip to main content

Module thread_local

Module thread_local 

Source
Expand description

Thread-local storage for compute resources

This module provides thread-local access to compute resources (Rayon pool and semaphore) for Tokio worker threads. This eliminates the need to pass Runtime or ComputePool references through async function calls.

Structs§

ComputeContext
Compute resources available to a Tokio worker thread

Functions§

assert_compute_context
Assert that the current thread has compute context initialized
get_pool
Get the compute pool from thread-local context
has_compute_context
Check if the current thread has compute context initialized
initialize_context
Initialize the thread-local compute context
try_acquire_block_permit
Try to acquire a block_in_place permit from thread-local context
with_context
Access the thread-local compute context