hnes / libaco

A blazing fast and lightweight C asymmetric coroutine library 💎 ⛅🚀⛅🌞
https://libaco.org
Apache License 2.0
3.51k stars 391 forks source link

Thread local storage support #46

Open vluttine opened 3 years ago

vluttine commented 3 years ago

Any possibility to add support for thread (coroutine) local variables?

That would be very useful, thanks!

PunchShadow commented 3 years ago

To my best knowledge, coroutines work on the same thread. Therefore, they share the same thread-local storage. You can use malloc for local variables to avoid race conditions.