cqueues
cqueues copied to clipboard
cqueue resume order
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.
The order is undefined: it is currently LIFO because it:
- is the fastest in code (just add to/remove from head of a linked list)
- 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.