logo

Crowdly

Two threads, T1 and T2, are executing in parallel. Can a deadlock occur? Justif...

✅ 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);

}

More questions like this

Want instant access to all verified answers on fpmi.bg?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!