muthukumarm
muthukumarm

Reputation: 197

Thread.Start() vs BackgroundWorker

what is the difference between create thread using thread.start and using background worker ?

Upvotes: 5

Views: 1888

Answers (3)

Benny
Benny

Reputation: 8815

the big advantage of BackgroundWorker is that you can call GUI code in it's ProgressChanged event handler.

Upvotes: 1

Brian Rasmussen
Brian Rasmussen

Reputation: 116401

A background worker uses a thread from the thread pool. Thread pool threads are regular threads but as they are reused the cost of starting them is amortized. As the cost of starting a thread may be significant the thread pool is ideal for short running tasks.

Upvotes: 3

Darin Dimitrov
Darin Dimitrov

Reputation: 1038790

Assuming you are talking about .NET a BackgroundWorker uses a thread from the thread pool (it doesn't create a new thread but it might block if there are no threads available in the pool) while Thread.Start starts a new managed thread.

Upvotes: 11

Related Questions