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§
- Thread
Pool - Represents a user-created thread pool.
- Thread
Pool Builder - Used to create a new
ThreadPoolor to configure the global rayon thread pool.
Traits§
- From
Parallel Iterator FromParallelIteratorimplements the creation of a collection from aParallelIterator. By implementingFromParallelIteratorfor a given type, you define how it will be created from an iterator.- Indexed
Parallel Iterator - An iterator that supports “random access” to its data, meaning that you can split it at arbitrary indices and draw data from those points.
- Into
Parallel Iterator IntoParallelIteratorimplements the conversion to aParallelIterator.- Into
Parallel RefIterator IntoParallelRefIteratorimplements the conversion to aParallelIterator, providing shared references to the data.- Into
Parallel RefMut Iterator IntoParallelRefMutIteratorimplements the conversion to aParallelIterator, providing mutable references to the data.- Parallel
Bridge - Conversion trait to convert an
Iteratorto aParallelIterator. - Parallel
Drain Full ParallelDrainFullcreates a parallel iterator that moves all items from a collection while retaining the original capacity.- Parallel
Drain Range ParallelDrainRangecreates a parallel iterator that moves a range of items from a collection while retaining the original capacity.- Parallel
Extend ParallelExtendextends an existing collection with items from aParallelIterator.- Parallel
Iterator - Parallel version of the standard iterator trait.
- Parallel
Slice - Parallel extensions for slices.
- Parallel
Slice Mut - Parallel extensions for mutable slices.
- Parallel
String - 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
sand invokes the closure with a reference tos. This closure can then spawn asynchronous tasks intos. Those tasks may run asynchronously with respect to the closure; they may themselves spawn additional tasks intos. When the closure returns, it will block until all tasks that have been spawned intoscomplete. - 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
'staticlifetime. If you want to spawn a task that references stack data, use thescope()function to create a scope.