That's because what you need is Fiber-local storage no?
What happens when you call an API that isn't fiber-aware and uses thread-local storage in its implementation?
Basically your entire stack needs to be fiber-aware, or you can't use them.
Re:Fibers: An Elegant Windows API
by petermcneeley on Friday March 29, 2019 @11:03AM
(#19522294)
Yes this is actually a significant issue since TLS is used in many cases to implement locks and mutex.
https://docs.microsoft.com/en-us/windows/desktop/procthread/...