Foreground thread – thread that is critical, application will not end up to thread will not be finished.
Background thread – not critical, it can be interrupted during application close
example
1 2 3 4 |
Thread backgroundThread = new Thread(new ThreadStart(p.PrintNumbers)); backgroundThread.Name = "Secondary"; backgroundThread.IsBackground = true; // <<< Background thread !!! backgroundThread.Start(); |