# coroutines

Zac Sweers

12/12/2023, 8:04 PM
Edit: Solution in thread 🧵 Was encouraged to bring this here from another slack I am once again wondering if I understand how coroutines work and it's an issue that's stumped a few of us 😅 Trying to add basic parallelization using a parallel mapping function in 1. Create new thread pool context: 2. that context is passed to the runner: 3. context is used in
withContext() 4. Each rail runs on the same thread despite the context's dispatcher being backed with a n=size thread pool 🤔. Same behavior happens with
too The parallel mapper does work internally as expected (with some fun tests), so I don't think it's an issue with that function directly
Solved: problem was the use of
in the parallel mapper, which ran on the same thread until a suspension point. As the function called in the body wasn't a suspend function, no suspension point ever occurred
👍 4
👍🏾 2