- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Background and foreground thread in C#
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.IsBackground = true; bgThread.Start();
Foreground threads continue to run until the last foreground thread is terminated.
When all the foreground threads are stopped, the application is closed. The default threads that are created are foreground threads.
- How to change JLabel background and foreground color in Java?
- Customize the tooltip font, color , background and foreground color in Java
- How to change the background and foreground colors of tab in Java?
- How can we set the foreground and background color to JComboBox items in Java?
- How can we change the background and foreground color of a JTooltip in Java?
- How to detect if an iOS application is in background or foreground?
- How to check if an iOS program is in foreground or in background?
- How to check whether a thread is a background thread or not in C#
- How to detect when an Android app goes to the background and come back to the foreground?
- How can we set the background/foreground color for individual column of a JTable in Java?
- Difference between Fixed thread pool and cached thread pool.
- Threads and Thread Synchronization in C#
- Difference between Process and Thread
- Main thread vs child thread in C#
- User Thread vs Daemon Thread in Java?