We should finalize the name for the main Android dispatcher for 1.0 release of coroutines. The current name is UI, but Android documentation names the corresponding concept "the main thread" (see also here https://github.com/Kotlin/kotlinx.coroutines/issues/427#issuecomment-403562661). Arguably, with structured concurrency (see #410) this name would not be used much often, but we still need to make sure it is clearly named.
I strongly prefer MainThread for a few reasons:
I agree with @JakeWharton
it's possible for a UI thread to be different from the main thread in the case of system apps with multiple views on different threads. Therefore, you should annotate methods associated with an app's view hierarchy with @ UiThread and annotate only methods associated with an app's lifecycle with @ MainThread.
https://developer.android.com/studio/write/annotations#thread-annotations
Currently Android integration uses the Main thread.
Moreover it is better use "Main" instead of "UI" here
Seconding Main which matches existing APIs (https://developer.android.com/reference/android/os/Looper#getMainLooper()) and is more accurate.
While we are at it, lets reopen discussion #41 about structures for all dispatcher name. Now, when we are about to release structured concurrency (#410) you would not have to mention the dispatcher names too often, so it makes sense to group them all.
Most helpful comment
I strongly prefer
MainThreadfor a few reasons: