just read a CHERI paper https://www.cl.cam.ac.uk/research/security/ctsrd/pdfs/202404asplos-cornucopia-reloaded.pdf
by that i mean of course i read enough
you can solve this! recursive scheduling is possible! (the Lyons 2016 seL4 paper pretends not to notice their own citation saying this outright, disappointed in her for this)
like personally if i was gonna expound at length on how slow my garbage collector is to free memory, i would also not neg people with phrasing like "aggregate overhead". the single most concerning loose end unaddressed is not aggregate overhead, but what may fancifully be thought instead to appear as a sudden but incomplete stall (to the process getting hammered)
one thing people do a lot (especially university professors teaching operating systems courses) is to describe the two options available as:
- coöperative,
- preëmptive,
these two are not "extremes", and they have no "middle ground"
(yes there is a graph in the next post)
on a fully preëmptive system (all of them), the kernel scheduler is almost always a weighted round robin for the past 50 years. however, we can understand this more generally:
- unidirectional (decontextualized) control transfer
- this necessarily picks times convenient for the scheduler
- scheduled items each execute for a static "time slice"op
we can invert much of the above statements, but not all them. for "full" coöperation:
- still unidirectional, still decontextualized control transfer
- unlike preëmption, this picks times entirely within the preferences of the scheduled
i will make one claim about coöperation:
- this enables fewer context switches, which loses less time and energy
i will make one claim about preëmption:
- it is incredibly hostile to synchronous ISAs with hierarchical LRU caching (all of them)
worth noting for a moment that every async in every language employs a fully-coöperative model through coroutines or callbacks
and every native threading runtime (via the OS scheduler) is executed fully preëmptively!
this is why explicit threading is 1-2 orders of magnitude faster than async in, for example rust i/o and filesystem operations like we perform in the zip crate. no trick here, it just does not actively subvert the assumptions of the OS-enforced preëmption