Stefan Evans wrote:
However it won't guarantee anything about how many threads can retrieve a reference from the Map. You would need some sort of locking/semaphore logic for that.
}public V get(Object key) {
synchronized (mutex) {return m.get(key);}
Sidharth Pallai wrote:If you just invoke run() directly, it's executed on the calling thread, just like any other method call. A new call stack never gets created.Thread.start() is required to actually create a new thread/new call stack so that the runnable's run method is executed in parallel.start() enable the Thread to be controlled in states.
start() is not invoked for the main method thread or "system" or group threads created/set up by the VM. Any new functionality added to this method in the future may have to also be added to the VM.