What are Foreground and Background Threads?
Threads are means to parallelize the work being done so that a given task can be accomplished quickly. There exists two broad classification of threads they are called as Foreground and Background Threads. Let us look at them one by one with the help of some examples. Here we will be seeing some examples from the c# context. Foreground Thread These are the threads which are created by default. These Threads run until its task gets finished and is not dependent on other threads such as other foreground threads. In other words it can be said that an application is kept alive until all its Foreground thread completes its execution and terminates. Foreground Threads are mainly used to perform Application critical tasks such as processing the application data which is required to be shown in the User Interface. Syntax for creating a Foreground Thread: Creating a Foreground Thread Background Thread Background Threads are the threads whose lifetime depends on the Foreground Thread of th...