How to Create a Deadlock In Java with One Thread

A deadlock is a situation in computer programming where two or more processes are blocked, each waiting for the other to release a resource that they need in order to continue executing. As a result, all the processes remain blocked indefinitely and are unable to make further progress. In the context of multithreading, a deadlock… read more »

What are concurrency problems and how to avoid them in Java

Concurrency problems appear when your code is executed by more than one thread. Then, in contrast to a single-threaded execution, your code might behave differently depending on when and which thread accesses a variable. Here is an example: In the above code: There is a static variable counter starting from 0. A fixed thread pool… read more »