A Noob question, when I print `Thread.currentThrea...
# coroutines
g
A Noob question, when I print
Thread.currentThread().name
, what exactly does
@coroutine#id
indicate (I understand it's an identifier to coroutine, but what exact piece of work does it indicate)? Is it the work the current thread does from one suspension point to till it encounters another suspension point? What exactly is a
@coroutine#id
physically translates to?
o
coroutines have an
CoroutineName
element that is attached to the current thread name when the debug sys prop is enabled when unspecified it is incremented from the name of the parent., or
coroutine
if there is none
g
Yes, I get it it's an identifier to coroutine, but my question is what piece of work does it indicate? When will it be incremented?
o
the ID is incremented as part of
newCoroutineContext
, so
coroutineScope
and
withContext
do not increment the ID, but
launch
and
async
, etc. any concurrency will
g
Thanks @octylFractal 🙂