Does someone know the difference between
Dispatcher.BeginInvoke(DispatcherPriority.Background, new ThreadStart(() =>
{
and
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() =>
{
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There should be no difference.
ThreadStartandActionare defined asi.e., delegate with no parameters and no return value. So they are semantically the same.
However, I would use
Actionand notThreadStart, asThreadStartis strongly associated withThreadconstructor, so the code withThreadStartcan hint to direct thread creation and therefore be slightly misleading.