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

cqueue resume order #197

Open
aleclarson opened this issue Apr 18, 2018 · 1 comment
Open

cqueue resume order #197

aleclarson opened this issue Apr 18, 2018 · 1 comment
Labels

Comments

@aleclarson
Copy link

aleclarson commented Apr 18, 2018

Why are new coroutines inserted at the head of their cqueue? This causes newer coroutines to be resumed first, which seems counter-intuitive, but I must be missing something.

@daurnimator
Copy link
Collaborator

The order is undefined: it is currently LIFO because it:

  1. is the fastest in code (just add to/remove from head of a linked list)
  2. may make use of warm cpu caches by resuming the most recent piece of code

I recall discussion of making the scheduling algorithm pluggable; but nothing lately.

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

No branches or pull requests

2 participants