Organizational Research By

Surprising Reserch Topic questions - Question:How can you take care of mutual exclusion using Java threads?

Mutual exclusion is a phenomenon where no two processes can access critical regions of memory at the same time. Using Java multithreading we can arrive at mutual exclusion. For mutual exclusion, you can simply use the synchronized keyword and explicitly or implicitly provide an Object, any Object, to synchronize on. The synchronized keyword can be applied to a class, to a method, or to a block of code. There are several methods in Java used for communicating mutually exclusive threads such as wait( ), notify( ), or notifyAll( ). For example, the notifyAll( ) method wakes up all threads that are in the wait list of an object.

asked Sep 13, 2013 in Core java by ashish singh
edited Sep 12, 2013
0 votes

Related Hot Questions

Government Jobs Opening