Java - How Many Thread Would be Run
Whatever "extends Thread" or "implements Runnable", it just says the object can be run on multithreading, therefore, how many thread would be created is based on how many constructor of the thread is run.
In an addition, should concern how many thread creation there, and the thread should not be for small section of code. If too many there, the computer would be overload. If too few, the performance would be not good.
Thread
In an addition, should concern how many thread creation there, and the thread should not be for small section of code. If too many there, the computer would be overload. If too few, the performance would be not good.
Thread
Object o1 = new Object();Runnable
Object o2 = new Object();
o1.start();
o2.start();
Thread t1 = new Thread(new Object());Reference
Thread t2 = new Thread(new Object());
t1.start();
t2.start();
- http://oreilly.com/catalog/expjava/excerpt/index.html