if you have some normal function / code, is there ...
# coroutines
t
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.
1
Apparently no simple solution besides using thread local
t
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?
m
Yea agreed, I don't understand either 😕
t
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...