Reputation: 173
I need to understand that if I have a single IO thread in a system, I run a multiple IO operations on multiple coroutines, can those coroutines use the very same thread in a suspended manner (meaning when coroutine A is waiting for IO result, coroutine B can utilise that thread for its IO operation) or the Thread will be blocked by the first IO operation?
Upvotes: 3
Views: 490
Reputation: 28708
It depends on what kind of IO operation you are doing. If you are doing an asynchronous IO operation, then this IO operation does not block the thread and let other coroutines use it. If you are doing a blocking IO operation, then it blocks the thread and other coroutines cannot use it.
Upvotes: 5