if you have some normal function / code, is there a way to tell if your in a coroutine, or just a normal code path? For logging, I'd like to add the coroutine name (if it exits). but logging calls can be called from anywhere, inside or outside of coroutines.
Apparently no simple solution besides using thread local
07/28/2021, 7:30 PM
I don't understand. coroutine to threads is a M:N mapping. How does using thread local help?
except in the case where 1 coroutine = 1 thread? In which case why use coroutines at all?
07/28/2021, 9:50 PM
Yea agreed, I don't understand either 😕
07/30/2021, 12:23 AM
actually, since I'm using my own dispatcher, and coroutineContext it's actually pretty simple to update ThreadLocal any time a dispatch/resume a coroutine.... but only because I have my own executetor...