Click here to Skip to main content
Click here to Skip to main content

How to run method in separate thread

By , 24 Mar 2011
 
Or in the new framework 4.0 use parallel tasks?
private void MethodStarter()
{
    Task myFirstTask = Task.Factory.StartNew(Method1);
    Task mySecondTask = Task.Factory.StartNew(Method1);
}
 
private void Method1()
{
}
 
private void Method2()
{
}
 
Sascha Barber wrote this[^] excellent article about Parallel Tasks.

License

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

About the Author

Eduard Keilholz
Software Developer (Senior) http://www.upbound.com
Netherlands Netherlands
In 1998 I started as webdesigner programming websites in Perl and later PHP. After two years wrote most of the websites in ASP and from then on lost the feeling with a linux/unix platform.
 
Since 2001 interested in Windows applications and now writing software using mostly C# for about 7 years now.
Follow on   Twitter

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionHow-to-run-method-in-separate-thread and call back methodmemberTridip Bhattacharjee19-Jul-12 20:49 
AnswerRe: How-to-run-method-in-separate-thread and call back methodmemberEduard Keilholz23-Aug-12 0:47 
GeneralReason for my vote of 4 preferedmemberBenjamin Uboegbu5-Nov-11 0:16 
GeneralReason for my vote of 5 Agree! 5 mvpManfred R. Bihy27-Mar-11 12:15 
Reason for my vote of 5
Agree! 5

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130619.1 | Last Updated 25 Mar 2011
Article Copyright 2011 by Eduard Keilholz
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid