class MyThread implements Runnable {
...
public void run() {
// do something;
}
}
class StartTwoThread {
public static void main(
String[] args) {
MyThread t1 = new MyThread(..);
MyThread t2 = new MyThread(..);
t1.start();
t2.start();
}
}
Question -- I want to simulate t1 and t2 to simultaneously do something on a single object, but I just don't know how to exactly let them start at the same time. For the above code, will t1 and t2 start at the same time ? or will t1 start "little" bit earlier than t2 does ?