subject

Consider the following two functions, where A and B are arbitrary computations: f1(){P(s1);c1 = c1+1;if(c1==1)P(d);V(s1);A();P(s1); c1 = c1-1;if (c1 ==0) V(d);V(s1);}

f2(){P(s2);c2 = c2+1;if(c2==1)P(d);V(s2);B();P(s2); c2 = c2-1;if (c2 ==0)V(d);V(s2);}

Initially, s1=s2=d=1; c1=c2=0;

Assume that an unbounded number of processes are invoking either of the functions f1() aor f2().

How many invocations of the computation A() can proceed concurrently? What are the values of s1, c1, and d at that time?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Create a cell reference in a formula by typing in the cell name or         a. right-clicking the cell. b. clicking the cell. c. clicking the column where the cell is located. d. clicking the row where the cell is located.
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
question
Computers and Technology, 22.06.2019 12:10
Linux is distributed under gnu gpl. why is this important? a. it ensures that only torvalds can profit from the sale of linux b. it prevents unknowledgeable users from downloading programs they don't know how to operate. c. it provides protection for the developers who created linux. d. it states that anyone can copy, modify, and share the program if changes are made public.
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Jane’s team is using the v-shaped model for their project. during the high-level design phase of the project, testers perform integration testing. what is the purpose of an integration test plan in the v-model of development? a. checks if the team has gathered all the requirements b. checks how the product interacts with external systems c. checks the flow of data in internal modules d. checks how the product works from the client side
Answers: 1
You know the right answer?
Consider the following two functions, where A and B are arbitrary computations: f1(){P(s1);c1 = c1+...
Questions
question
Mathematics, 24.02.2021 20:50
question
English, 24.02.2021 20:50
question
Mathematics, 24.02.2021 20:50
question
Mathematics, 24.02.2021 20:50
Questions on the website: 13722360