'How important is it to specify dispatchers/context in Kotlin coroutines? What happens if you don't specify them?

If a coroutine was launched and no dispatcher was specified (eg. GlobalScope.launch {}), what dispatcher is used?

If that coroutine was launched in the main thread, would it use Dispatchers.main?

Also, what happens if you do not specify dispatchers or context in your coroutines? Say you did database operations, but didn't specify Dispatchers.IO anywhere. Would that cause any major issues?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source