JAVA Tutorials

Inter-Thread Communication in Java – Part 1 : Free Java Tutorials

Inter-Thread Communication encompasses those Java concepts and features using which threads can communicate with each other. This communication helps to reduce the unnecessary waiting time of threads. Thus, it helps to improve overall performance. Two threads can communicate with each other by using wait(), notify() and notifyAll() methods. The thread which is expecting updation is …

Inter-Thread Communication in Java – Part 1 : Free Java Tutorials Read More »

Inter-Thread Communication in Java – Part 2 : Free Java Tutorials

Inter-Thread Communication encompasses those Java concepts and features using which threads can communicate with each other. This communication helps to reduce the unnecessary waiting time of threads. Thus, it helps to improve overall performance. Two threads can communicate with each other by using wait(), notify() and notifyAll() methods. In this tutorial, we will see an …

Inter-Thread Communication in Java – Part 2 : Free Java Tutorials Read More »

Thread Synchronization using Synchronized Block in Java : Free Java Tutorials

Synchronized Block is an alternate way to perform thread synchronization in Java. It reduces unnecessary overhead as it makes only a portion of a method synchronized instead of making the entire method synchronized. If only a few lines of the code require synchronization, then it is not feasible to declare an entire method as synchronized …

Thread Synchronization using Synchronized Block in Java : Free Java Tutorials Read More »

Object vs Class Level Locks for Thread Synchronization in Java : Free Java Tutorials

There exist two types of locks in Java to carry out thread synchronization. They are object level lock and class level lock. These two locks are always there for each class as well as each object in java to support thread synchronization. Object level vs Class level locks in thread synchronization In thread synchronization, there …

Object vs Class Level Locks for Thread Synchronization in Java : Free Java Tutorials Read More »

Thread Synchronization and Locking Mechanism in Java : Free Java Tutorials

Thread Synchronization is done in Java using the synchronized keyword which uses locking mechanism to synchronize threads in a multi-threaded environment. Synchronized is the modifier applicable to methods and blocks. It is not applicable to variables and classes. If multiple threads are trying to operate on the same java object simultaneously, then there is a …

Thread Synchronization and Locking Mechanism in Java : Free Java Tutorials Read More »