# Background and foreground thread in C#

CsharpServer Side ProgrammingProgramming

#### CSharp Online Training

59 Lectures 6.5 hours

A thread is defined as the execution path of a program. Each thread defines a unique flow of control

When the foreground threads will close, the background threads will be terminated.

The property used for background thread is IsBackground that gets or sets a value indicating whether a thread is a background thread. The default value of this property would be false because the default threads created are Foreground Threads.

To create a background thread −

Thread bgThread = new Thread(tStart);
bgThread.Start();