Showing the changes to git-features/src/parallel (2 of 58 files). Show all
Unified · Split
| @@ -16,7 +16,7 @@ pub fn join<O1: Send, O2: Send>(left: impl FnOnce() -> O1 + Send, right: impl Fn · 15 unmodified lines | |||
| 16 | /// That way it's possible to handle threads without needing the 'static lifetime for data they interact with. | 16 | /// That way it's possible to handle threads without needing the 'static lifetime for data they interact with. |
| 17 | /// | 17 | /// |
| 18 | /// Note that the threads should not rely on actual parallelism as threading might be turned off entirely, hence should not | 18 | /// Note that the threads should not rely on actual parallelism as threading might be turned off entirely, hence should not |
| 19 | /// connect each other with channels as deadlock would occour in single-threaded mode. | 19 | /// connect each other with channels as deadlock would occur in single-threaded mode. |
| 20 | pub fn threads<'env, F, R>(f: F) -> std::thread::Result<R> | 20 | pub fn threads<'env, F, R>(f: F) -> std::thread::Result<R> |
| 21 | where | 21 | where |
| 22 | F: FnOnce(&crossbeam_utils::thread::Scope<'env>) -> R, | 22 | F: FnOnce(&crossbeam_utils::thread::Scope<'env>) -> R, |
| @@ -85,7 +85,7 @@ where · 62 unmodified lines | |||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | /// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state. | 87 | /// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state. |
| 88 | /// This is only good for operations where near-random access isn't detremental, so it's not usually great | 88 | /// This is only good for operations where near-random access isn't detrimental, so it's not usually great |
| 89 | /// for file-io as it won't make use of sorted inputs well. | 89 | /// for file-io as it won't make use of sorted inputs well. |
| 90 | /// Note that `periodic` is not guaranteed to be called in case other threads come up first and finish too fast. | 90 | /// Note that `periodic` is not guaranteed to be called in case other threads come up first and finish too fast. |
| 91 | // TODO: better docs | 91 | // TODO: better docs |
| @@ -57,7 +57,7 @@ mod not_parallel { · 56 unmodified lines | |||
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | /// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state. | 59 | /// An experiment to have fine-grained per-item parallelization with built-in aggregation via thread state. |
| 60 | /// This is only good for operations where near-random access isn't detremental, so it's not usually great | 60 | /// This is only good for operations where near-random access isn't detrimental, so it's not usually great |
| 61 | /// for file-io as it won't make use of sorted inputs well. | 61 | /// for file-io as it won't make use of sorted inputs well. |
| 62 | // TODO: better docs | 62 | // TODO: better docs |
| 63 | pub fn in_parallel_with_slice<I, S, E>( | 63 | pub fn in_parallel_with_slice<I, S, E>( |