Click here to Skip to main content
15,885,839 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hi friends,
What is the difference between Thread pool and Backgroundworker?How to use them in a C#.net Project?
Posted
Comments
NikulDarji 14-Dec-11 5:14am    
My 5+...:)

A BackgroundWorker is a ready to use class in WinForms allowing you to execute tasks on background threads which avoids freezing the UI and in addition to this allows you to easily marshal the execution of the success callback on the main thread which gives you the possibility to update the user interface with the results. It also gives the possibility to track progress and cancel the task. It uses threads from the thread pool.

On the other hand a Thread is a class allowing you to simply execute some task on a new thread. It's a much more basic concept.

http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[^]


http://msdn.microsoft.com/en-us/library/system.threading.thread.aspx[^]
 
Share this answer
 
A BackgroundWorker is a ready to use class in WinForms allowing you to execute tasks on background threads which avoids freezing the UI and in addition to this allows you to easily marshal the execution of the success callback on the main thread which gives you the possibility to update the user interface with the results. It also gives the possibility to track progress and cancel the task. It uses threads from the thread pool.

On the other hand a Thread is a class allowing you to simply execute some task on a new thread. It's a much more basic concept.

To use thread pool see

http://msdn.microsoft.com/en-us/library/3dasc8as(v=vs.80).aspx[^]

To use how to use backgroundworker see

http://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx[^]
 
Share this answer
 
Comments
NikulDarji 14-Dec-11 5:12am    
we answered form same link......:)
Balakrishnan Dhinakaran 15-Dec-11 1:06am    
ha ha hope so :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900