Question: Consider the following code: public class myFirstThread extends Thread { public class mySecondThread extends Thread { Semaphore 31, 32, 33; Semaphore 31,32,33; public myFirstThread (Semaphore

 Consider the following code: public class myFirstThread extends Thread { public

Consider the following code: public class myFirstThread extends Thread { public class mySecondThread extends Thread { Semaphore 31, 32, 33; Semaphore 31,32,33; public myFirstThread (Semaphore a, Semaphore b, Semaphore c) { public mysecondThread (Semaphore a, Semaphore b, Semaphore c) { s1 = a; s1 = a; 32 = b; 32 = b; 33 = c; 33 = c; public void run() { //first thread implementation public void run() { // second thread implementation public static void main(String[] args) { Semaphore 31 = new Semaphore (1); Semaphore 32 = new Semaphore (2); Semaphore 33 = new Semaphore (1); Thread ti = new myFirstThread (31,32,33); Thread t2 = new mySecondThread (31, 32, 33); t1.start(); t2.start(); Which of the following pairs of implementations of the run methods can deadlock? Exception handling code (try, catch) has been omitted for clarity. first thread implementation second thread implementation a public void run() { 31.acquire(); 31.release(); public void run() { 33. acquire(); 33. release (); } b public void run() { 31.acquire(); 33. acquire(); 31.release(); public void run() { 31.acquire(); 33. acquire(); 31. release (); 33.release(); 33. release (); } public void run() { public void run() { 33. acquire(); 31.acquire(); 31.acquire(); 33. acquire(); 31.release(); 33. release (); 31. release (); 33. release (); } } d public void run() { 31.acquire(); 33. acquire(); 31.release(); 33. release (); public void run() { 31.acquire(); 31.release(); e public void run() { 32.acquire(); 33. acquire(); 33. release (); 32.release (); public void run() { 33. acquire(); 32.acquire(); 32.release(); 33. release(); } f public void run() { 31.acquire(); 33. acquire(); 31.release(); 33. release(); public void run() { 31.acquire(); 33. acquire(); 31. release (); 32.release(); } public void run() { 31.acquire(); 33. release(); public void run() { 33. acquire(); 31.release(); } } Select one or more: a b d Of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!