Multithreading Interview Question-1

Question 1. What is Thread in java? Answer. Threads consumes CPU in best possible manner, hence enables multi processing. Multi threading reduces idle time of CPU which improves performance of application. Thread are light weight process. A thread class belongs to java.lang package. We can create multiple threads in java,…

Continue reading

Race condition in Java multi-threading

Race condition occurs in a multi-threaded environment when more than one thread try to access a shared resource (modify, write) at the same time. Note that it is safe if multiple threads are trying to read a shared resource as long as they are not trying to change it. Since…

Continue reading

Interview Question and Answer on Threading-2

1. What do we understand by the term concurrency? Concurrency is the ability of a program to execute several computations simultaneously. This can be achieved by distributing the computations over the available CPU cores of a machine or even over different machines within the same network. 2. What is the…

Continue reading

Inteview Question and Answer on Threading

What is race condition in java A race condition is a situation in which two or more threads or processes are reading or writing some shared data and their is no proper synchronization which result in unexpected output.Therefore, the result of the change in data is dependent on the thread…

Continue reading