Stackful Coroutine Made Fast

(photonlibos.github.io)

7 points | by todsacerdoti 11 hours ago ago

1 comments

  • mrgriffin 4 hours ago ago

    Making all registers caller-saved around context switches is a neat insight, it's intuitive how that could potentially lead to needing fewer instructions to execute when switching contexts.

    I haven't yet digested exactly how the stacks are made to work. I think fig 8 should be obvious, but I'm getting stuck on picturing how the system guarantees that frame 1 can't grow into frame 2.

    EDIT: Ah, I think I understand. It seems that they're taking advantage of a large virtual address space to give each stack loads of space, rather than them being contiguous like I assumed from fig 8.

    > As modern 64-bit address-space is big enough for the allocation of many large continuous stacks [...]