简体   繁体   中英

Does Kotlin coroutine runs in the same process where the application live?

I am new to kotlin coroutine, I need to know how kotlin coroutine manage its threading work internally.

Does it uses separate thread for each task?

Does kotlin coroutine stays in the same process where the application live?

Does kotlin coroutine change the process during any intermediate task?

As far as I know, Coroutine uses a thread pool to run tasks.

So we can say as the point of Coroutine users' view each task will run on a separate thread but under the hood, it's just a thread pool.

And for the process yes. It's in the same process as the application is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM