✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Two threads, T1 and T2, are executing in parallel. Can a deadlock occur? Justify your answer.
void thread1() {
lock(A);
...
lock(B);
...
unlock(B);
unlock(A);
}
void thread2() {
lock(B);
...
lock(A);
...
unlock(A);
unlock(B);
}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!