Hi! If I have a `newSingleThreadedCoroutrineContex...
# coroutines
v
Hi! If I have a
newSingleThreadedCoroutrineContext
, and a bunch of coroutine launched with it, a) will the coroutines execute in the order of their creation? b) will the execution prefer the first coroutine more than the last after some suspends and resumes?
v
Hi, a) In order of their dispatching, not creation. E.g. consider
CoroutineStart.Lazy
b) Which coroutine is the first and which one is the last? In general
newSingleThread
(and
newThreadPoolContext
) are backed by
java.util.concurrent.ThreadPoolExecutor
, so if coroutine
A
was dispatched before coroutine
B
, then it will start its execution before
B
, following original executor FIFO policy