EMERGING TRENDS IN SOFTWARE ENGINEERING
CLOUD COMPUTING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Consider the following statements:Statement 1:When two processes are competing with each other causing data corruption, it is called deadlock. Statement 2:When two processes are waiting for each other directly or indirectly, it is called race condition.
|
Only statement 1 is true
|
|
Only statement 2 is true
|
|
Both statements are true
|
|
Both statements are false
|
Explanation:
Detailed explanation-1: -Race Condition And Deadlock A race condition occurs when two threads use the same variable at a given time. Deadlock exists when two threads seek one lock simultaneously.
Detailed explanation-2: -A deadlock occurs when two threads each lock a different variable at the same time and then try to lock the variable that the other thread already locked. As a result, each thread stops executing and waits for the other thread to release the variable.
There is 1 question to complete.