Kotlin Coroutines
Coroutines are nothing but lightweight threads. Coroutines provide us an easy way to do synchronous and asynchronous programming. Coroutines allow execution to be suspended and resumed later at some point in the future which is best suited for performing non-blocking operations in the case of multithreading. Coroutines is a lightweight thread because creating coroutines doesn't allocate new threads. Instead, they use predefined thread pools, and smart scheduling. Scheduling is the process of determining which piece of work you will execute next.. Is called on suspending functions. We can suspend and resume the Coroutines while execution. This means we can have a long-running task, which can be executed one by one or which can be executed little-by-little.. We can pause it any number of times and resume it when we are ready again. Advantages/Properties : Run 1 background thread & Multiple Coroutines Light Weight Threads Can run in parallel Can wait for each other Communicate wi...