Java Multi threading Archive
There are some difference key notes i conclude after working on wait and sleep, first take a look on sample using wait() and sleep(): Example1: using wait() and sleep(): synchronized(HandObject) { while(isHandFree() == false) { …
Interrupting a thread means stopping what it is doing before it has completed its task, effectively aborting its current operation. Whether the thread dies, waits for new tasks, or goes on to the next step …
While the suspend( ), resume( ), and stop( ) methods defined by Thread class seem to be a perfectly reasonable and convenient approach to managing the execution of threads, they must not be used for …
Inter Thread Communication is one of the distinct facility in multi threading application development of java. Inter thread communication concept is one of the specialized form of inter process communication of operating system. In real …
Deadlock can occur in a situation when a thread is waiting for an object lock, that is acquired by another thread and second thread is waiting for an object lock that is acquired by first …
A synchronized method or block works on a given monitor. Synchronized non-static methods all synchronize on the Java instance of a class. Each instance has a lock monitor. For the case of static methods, what …
Synchronized block can be used to perform synchronization on any specific resource of the method. Suppose you have 100 lines of code in your method, but you want to synchronize only 5 lines, you can …