C# Multithreading Example Tutorial

For better performance we can use multithreading in our programm. We use thread for heavy processes like load data from database or during use of Internet, otherwise you will feel hanged your User Interface.

In c sharp it is very easy to use multithreading.

Note:- Don’t update controls like label or buttons with in thread, because your user interface is not part of new created thread. Every application have a main thread also called UI Thread that handle user interface. If you will try to call user controls in background thread (new thread) then you will face an Exception of different thread.

Following example is showing how to use background thread (multi threading) in c#

Complete example with handling of user inteface is given below: