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

Unnecessary Context Swaps in Main Loop #307

Open
insertinterestingnamehere opened this issue Oct 21, 2024 · 0 comments
Open

Unnecessary Context Swaps in Main Loop #307

insertinterestingnamehere opened this issue Oct 21, 2024 · 0 comments

Comments

@insertinterestingnamehere
Copy link
Collaborator

The current main execution loop is structured so that each qthread jumps back to the worker thread running it so that the worker thread can then jump to whichever qthread it wants to execute next. At least in theory it shouldn't matter at all if we call into the threadqueue APIs while finalizing our work on one qthread vs calling them after the context swap away from it. It'd likely be more efficient if we restructured things so that each qthread just jumped straight to whichever qthread was going to be executed next if one's readily available in the queue to start executing. This would dramatically reduce the number of context swaps in the (expected) non-contended threadqueue case.

The main thread pool and execution loop are already in dire need of restructuring, this is just one of the key benefits we can pick up from that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant