I have a situation in which I want to start 3 threads called: tr1, tr2 and tr3
I want tr2 to start after tr1 and tr3 to start after tr2.
How can I achieve this?
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.
In Fx4 you can use Tasks and the ContinueWith feature.
And while it does make sense to have Tasks (Jobs) that must be run in sequence, it does not seem so sensible for Threads. Why don’t you use 1 Thread that executes m1(), m2() and m3() in sequence? Especially if you are on Fx <= 3.5
Another aspect here is error handling. The tasks library will handle that more or less invisible, but without it you need to take care.