You can use Task
to specify what you want to do then attach that Task
with a Thread
. so that Task
would be executed in that newly made Thread
rather than on the GUI thread.
Use Task
with the TaskFactory.StartNew(Action action)
. In here you execute a delegate so if you didn't use any thread it would be executed in the same thread (GUI thread). If you mention a thread you can execute this Task
in a different thread. This is an unnecessary work cause you can directly execute the delegate or attach that delegate to a thread and execute that delegate in that thread. So don't use it. it's just unnecessary. If you intend to optimize your software this is a good candidate to be removed.
**Please note that the Action
is a delegate
.