This is pretty cool! If I'm understanding this correctly, this would make it possible for green thread implementations to call FFI code with low-overhead? What are the plans to upstream this?
Not sure if it's quite the same, but also see <a href="https://docs.microsoft.com/en-us/windows/win32/procthread/user-mode-scheduling" rel="nofollow">https://docs.microsoft.com/en-us/windows/win32/procthread/us...</a>
The danger of user space scheduling: proprietary implementations of scheduling algorithms. Given enough time, instead of a huge effort for a scheduler that has few tunables and works reasonably well for most cases, we'll get a lot of proprietary schedulers that works very well but each for a single very specialized case. The end result maybe the out-of-the-box scheduler becomes neglected and mostly abandoned in the future.