Skip to content

Commit 9d0b315

Browse files
committed
Deprecate ThreadPoolBuilder::breadth_first()
1 parent a902c03 commit 9d0b315

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

rayon-core/src/lib.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,17 @@ impl ThreadPoolBuilder {
314314
self
315315
}
316316

317-
/// Suggest to worker threads that they execute spawned jobs in a
318-
/// "breadth-first" fashion. Typically, when a worker thread is
319-
/// idle or blocked, it will attempt to execute the job from the
320-
/// *top* of its local deque of work (i.e., the job most recently
321-
/// spawned). If this flag is set to true, however, workers will
322-
/// prefer to execute in a *breadth-first* fashion -- that is,
323-
/// they will search for jobs at the *bottom* of their local
324-
/// deque. (At present, workers *always* steal from the bottom of
325-
/// other worker's deques, regardless of the setting of this
326-
/// flag.)
317+
/// **(DEPRECATED)** Suggest to worker threads that they execute
318+
/// spawned jobs in a "breadth-first" fashion.
319+
///
320+
/// Typically, when a worker thread is idle or blocked, it will
321+
/// attempt to execute the job from the *top* of its local deque of
322+
/// work (i.e., the job most recently spawned). If this flag is set
323+
/// to true, however, workers will prefer to execute in a
324+
/// *breadth-first* fashion -- that is, they will search for jobs at
325+
/// the *bottom* of their local deque. (At present, workers *always*
326+
/// steal from the bottom of other worker's deques, regardless of
327+
/// the setting of this flag.)
327328
///
328329
/// If you think of the tasks as a tree, where a parent task
329330
/// spawns its children in the tree, then this flag loosely
@@ -334,6 +335,12 @@ impl ThreadPoolBuilder {
334335
/// execution is highly dynamic and the precise order in which
335336
/// independent tasks are executed is not intended to be
336337
/// guaranteed.
338+
///
339+
/// This `breadth_first()` method is now deprecated per [RFC #1],
340+
/// and in the future its effect may be removed.
341+
///
342+
/// [RFC #1]: https://github.com/rayon-rs/rfcs/pull/1
343+
#[deprecated(note = "use `scope_fifo` and `spawn_fifo` for similar effect")]
337344
pub fn breadth_first(mut self) -> Self {
338345
self.breadth_first = true;
339346
self

0 commit comments

Comments
 (0)