Threading in java vs C#
- by ffayyaz
I need a little confirmation over something i am confused at . I know how threads work in java.
new DialList(string a , string b).start(); // where DialList is a class
public class DialList extends Thread {
public DialList(String a, string b) {
FilePath = a;
ThreadLogFile = b";
}
public void run() {
// some code to run in different thread
}
}
Now i want to run same code in C# , Shall i put the code which is in run() into a method and do something like
Thread t = new Thread (runcsharp); // Kick off a new thread
t.Start();
static void runcsharp() {
// code
}
or is there some other way to do it ?