Hacker News new | past | comments | ask | show | jobs | submit login

What bonzini is referring to is actually a more subtle issue: the compiler will CSE the (hidden) thread_local address calculation even across function calls. So even if you are careful and do not assume that thread_local state is preserved across function calls, your code can still be wrong as suddenly it will be accessing a thread_local owned by another thread. That might be as simple as dereferencing the wrong errno.

It is very hard to workaround that in your code. The only practical solution is to never migrate coroutines to other threads.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: