Meet Patel

I am a passionate programmer, blogger, and developer by choice. I like to write and contribute to the developer community.

Thread Prevention and Deadlock in Java : Free Java Tutorials

Thread Prevention using join() method sometimes causes an unintended deadlock situation to arise. A deadlock situation occurs when there is a circular chain of threads each waiting for the other thread to finish its execution. Join() method can also be used to prevent child thread from executing before main thread. To do this, we have to …

Thread Prevention and Deadlock in Java : Free Java Tutorials Read More »

Thread Prevention using yield Method in Java : Free Java Tutorials

Thread prevention deals with how we can prevent a thread from executing on a temporary or permanent basis. We can prevent thread execution by using the 3 methods in Java namely yield, join and sleep method. Before understanding thread prevention, let’s first understand the life cycle of a thread. Look at the following diagram which …

Thread Prevention using yield Method in Java : Free Java Tutorials Read More »

Thread Prevention using join Method in Java : Free Java Tutorials and Online Training

Join method allows us to do thread prevention. If a thread wants to wait until the completion of some other thread, then we should go for join() method. For example, if a thread t1 wants to wait until completion of thread t2, then t1 has to call t2.join(). Thread’s join method is mainly used where …

Thread Prevention using join Method in Java : Free Java Tutorials and Online Training Read More »

Thread Priorities in Java : Free Java Tutorials and Online Training

Thread priorities decide the order of execution of threads in a multi-threaded environment. Every thread in Java has some priority. It may be default priority generated by JVM or customized priority provided by the programmer. Thread priority is defined by a number. The valid range of thread priorities is 1 to 10 where 1 is …

Thread Priorities in Java : Free Java Tutorials and Online Training Read More »