Multiple Threads
how do i create two threads running at the same time simultaneously?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Apr 15, 2013, 6:15 AM EDT
// in some method
Thread t1 = new Thread(ThreadMethod1);
Thread t2 = new Thread(ThreadMethod2);
t1.Start();
t2.Start();
// add method for first thread
private void ThreadMethod1()
{
// do some stuff in here
}
// add method for second thread
private void ThreadMethod2()
{
// do some other stuff in here
}
Raps Gao6 reputationPosted Apr 15, 2013, 6:21 AM EDT