Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate if StealRequest could be pointer object #7

Closed
mratsim opened this issue Nov 17, 2019 · 0 comments · Fixed by #13
Closed

Evaluate if StealRequest could be pointer object #7

mratsim opened this issue Nov 17, 2019 · 0 comments · Fixed by #13
Labels
enhancement :shipit: New feature or request

Comments

@mratsim
Copy link
Owner

mratsim commented Nov 17, 2019

Having Steal Request as pointer objects with ownership passed by channels instead of deep copy might reduce the overhead of the framework:

  • Lock-free MPSC list-based queues have a wealth of literature, this would avoids having to debug The MPSC channel has a deadlock #6 (though lock-free debugging is hard as well)
  • A bitset for 256 victims takes 32 bytes, with the rest of the data, the StealRequest size becomes quite big.
  • We could use a more efficient set suitable for random picking but that would use much more space (513 bytes instead of 32 for 256 max workers (Refactor the bitset data structure #5 (comment))

One useful thing is that steal request destruction only happen in the creating worker and since each steal requests maps to an unique task channel, we would know when the task is sent back, which steal request to destroy. Other worker can only dispose of their own steal requests.

This brings cheaper copy in the MPSC channel and easier lock-free implementation at the cost of a guaranteed cache miss when reading the steal request and potentially increased latency on NUMA.

@mratsim mratsim added the enhancement :shipit: New feature or request label Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement :shipit: New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant