Skip to content

Conversation

@cuviper
Copy link
Member

@cuviper cuviper commented Dec 12, 2018

This implements rayon-rs/rfcs#1, adding spawn_fifo, scope_fifo, and ScopeFifo, and deprecating the breadth_first flag.

Fixes #590.
Closes #601.

@cuviper cuviper requested a review from nikomatsakis December 12, 2018 02:28
@cuviper
Copy link
Member Author

cuviper commented Dec 12, 2018

"WIP" only because I still need to add documentation.

Copy link
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modulo lack of documentation, this seems quite nice.

@cuviper cuviper mentioned this pull request Dec 14, 2018
Copy link
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see docs are still missing -- I didn't read the rebased code closely yet, just leaving these markers so I remember status.

@ghost
Copy link

ghost commented Jan 11, 2019

Just an informative "by the way" comment that might be interesting to think about, but doesn't affect this PR much.

Here's a quick comparison of TBB's and Rayon's approach to task scheduling:
https://www.threadingbuildingblocks.org/docs/help/reference/task_scheduler/scheduling_algorithm.html

TBB offers two ways to spawn a task:

  • task.execute() - similar to rayon::spawn() (push into the local LIFO queue)
  • task.enqueue() - similar to rayon::spawn_fifo() (push into the global FIFO queue)

There's also a notion of task arenas, which I suppose is similar to Rayon's scopes.

Another interesting difference is how task stealing works. TBB first attempts to steal from the global FIFO queue and then steals from other workers' LIFO queues. Rayon uses the reverse order. I have a feeling that in this case TBB's strategy might be slightly better.

@cuviper cuviper changed the title [WIP] Implement RFC #1: FIFO spawns Implement RFC #1: FIFO spawns Jan 30, 2019
@cuviper
Copy link
Member Author

cuviper commented Jan 30, 2019

Docs are ready for review!

@nikomatsakis
Copy link
Member

nikomatsakis commented Jan 31, 2019

r=me with nits fixed

@cuviper
Copy link
Member Author

cuviper commented Feb 2, 2019

bors r=nikomatsakis

bors bot added a commit that referenced this pull request Feb 2, 2019
615: Implement RFC #1: FIFO spawns r=nikomatsakis a=cuviper

This implements rayon-rs/rfcs#1, adding `spawn_fifo`, `scope_fifo`, and `ScopeFifo`, and deprecating the `breadth_first` flag.

Fixes #590.
Closes #601.

Co-authored-by: Josh Stone <[email protected]>
@bors
Copy link
Contributor

bors bot commented Feb 2, 2019

@bors bors bot merged commit 88d6a4e into rayon-rs:master Feb 2, 2019
@cuviper cuviper mentioned this pull request Mar 3, 2019
@cuviper cuviper deleted the rfc1 branch March 11, 2020 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants