Module parallel

Module parallel 

Source
Expand description

Parallel processing abstractions for OxiRS

This module provides unified parallel processing operations across the OxiRS ecosystem. All parallel operations must go through this module - direct Rayon usage in other modules is forbidden.

Structs§

ThreadPool
Represents a user-created thread pool.
ThreadPoolBuilder
Used to create a new ThreadPool or to configure the global rayon thread pool.

Traits§

FromParallelIterator
FromParallelIterator implements the creation of a collection from a ParallelIterator. By implementing FromParallelIterator for a given type, you define how it will be created from an iterator.
IndexedParallelIterator
An iterator that supports “random access” to its data, meaning that you can split it at arbitrary indices and draw data from those points.
IntoParallelIterator
IntoParallelIterator implements the conversion to a ParallelIterator.
IntoParallelRefIterator
IntoParallelRefIterator implements the conversion to a ParallelIterator, providing shared references to the data.
IntoParallelRefMutIterator
IntoParallelRefMutIterator implements the conversion to a ParallelIterator, providing mutable references to the data.
ParallelBridge
Conversion trait to convert an Iterator to a ParallelIterator.
ParallelDrainFull
ParallelDrainFull creates a parallel iterator that moves all items from a collection while retaining the original capacity.
ParallelDrainRange
ParallelDrainRange creates a parallel iterator that moves a range of items from a collection while retaining the original capacity.
ParallelExtend
ParallelExtend extends an existing collection with items from a ParallelIterator.
ParallelIterator
Parallel version of the standard iterator trait.
ParallelSlice
Parallel extensions for slices.
ParallelSliceMut
Parallel extensions for mutable slices.
ParallelString
Parallel extensions for strings.

Functions§

current_num_threads
Returns the number of threads in the current registry. If this code is executing within a Rayon thread pool, then this will be the number of threads for the thread pool of the current thread. Otherwise, it will be the number of threads for the global thread pool.
is_parallel_enabled
Check if parallel processing is enabled
join
Takes two closures and potentially runs them in parallel. It returns a pair of the results from those closures.
map
Map a function over a slice in parallel
num_threads
Get the number of threads available for parallel operations
par_chunks
Process a slice in parallel chunks
par_join
Execute two closures potentially in parallel
parallel_map
Map a function over a slice in parallel (alias for map)
scope
Creates a “fork-join” scope s and invokes the closure with a reference to s. This closure can then spawn asynchronous tasks into s. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks into s. When the closure returns, it will block until all tasks that have been spawned into s complete.
spawn
Puts the task into the Rayon thread pool’s job queue in the “static” or “global” scope. Just like a standard thread, this task is not tied to the current stack frame, and hence it cannot hold any references other than those with 'static lifetime. If you want to spawn a task that references stack data, use the scope() function to create a scope.