The user interface creates user interface elements and waits and responds to events such as mouse clicks and keystrokes. You can only access user interface elements from the user interface stream.
There are two types of streams: background and foreground. The user interface thread is an example of a front thread.
The difference between background and front threads is quite simple. Background threads do not stop the process from completing, but do foreground threads. When the last foreground thread stops, all background threads also stop and the process ends.
Arsen mkrtchyan
source share