logo

Crowdly

Can deadlock occur? Justify your answer.   void thread1() {     lock(r...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Can deadlock occur? Justify

your answer.

 

void thread1() {

    lock(resource1);

    lock(resource2);

    // work

    unlock(resource2);

    unlock(resource1);

}

 

void thread2() {

    lock(resource1);

    lock(resource2);

    // work

    unlock(resource2);

    unlock(resource1);

}

More questions like this

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

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