How to run method in separate thread






4.93/5 (14 votes)
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.