Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago