Click here to Skip to main content
12,623,724 members (31,836 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


8 bookmarked

How to run method in separate thread

, 24 Mar 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
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[^]...
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.


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)
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.

You may also be interested in...


Comments and Discussions

QuestionHow-to-run-method-in-separate-thread and call back method Pin
Tridip Bhattacharjee19-Jul-12 21:49
memberTridip Bhattacharjee19-Jul-12 21:49 
you come with nice article but you miss one thing. can you tell us how we can pass another function name as callback function. as a result when the execution of method1() will be completed then another method notify us. also show us how can i pass argument to method1() when when run method1() in separate thread. thanks

AnswerRe: How-to-run-method-in-separate-thread and call back method Pin
Eduard Keilholz23-Aug-12 1:47
memberEduard Keilholz23-Aug-12 1:47 
GeneralReason for my vote of 4 prefered Pin
Benjamin Uboegbu5-Nov-11 1:16
memberBenjamin Uboegbu5-Nov-11 1:16 
GeneralReason for my vote of 5 Agree! 5 Pin
Manfred R. Bihy27-Mar-11 13:15
mvpManfred R. Bihy27-Mar-11 13:15 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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