3 ms·
> Coroutines are lower-level [than M:N threading] Not sure I understand what you're trying to say here, this sounds exactly backwards to my reading. A green t
by ajross 9y ago
> Coroutines are lower-level [than M:N threading]
Not sure I understand what you're trying to say here, this sounds exactly backwards to my reading. A green threading library can be written in assembly language with no reference to anything but the hardware ISA specification and the ABI that defines the relevant calling convention. It's as "low level" as a software construct can be. The only lower level implementation I can think of are hardware-assisted context switching features like you see on some embedded architectures.
Coroutines, on the other hand, are artifacts of the language runtime and depend in sensitive ways on that whole stack. Much higher level.
- dragonwriter 9y ago> Not sure I understand what you're trying to say here The exact sense of the phrase you excerpted is explained in the next clause of the same sentence of the comment.
- ajross 9y agoOK, then that's backwards, sorry. The fact that A is hard to implement in terms of B doesn't mean that A is a "lower level" (or even "higher level") construct in the sense people usually use those terms. It just means that the two metaphors are incompatible. Honestly I was asking the question because I thought you had some deeper point in mind I couldn't see. But you just had it backwards.