subject

Class X has synchronized methods S1 and S2. Consider an instance xinstance of class X, consumer threads T1 and T2, and supplier thread T3, and the following sequence of actions on xinstance: Thread T1 enters method S1, and at some point issues a wait(), because T3 hasn't supplied yet Subsequently, thread T2 enters method S1, and at some point issues a wait(), because T3 hasn't supplied yet Finally, thread T3 enters method S2, fills in the supply, issues a notifyAll(), finishes and exits S2 Assume that T3's supply is sufficient for only one of the consumers, and that once T3 has finished executing S2 as above, it is terminated (i. e. it will not return to S2 again). But T1 and T2 are insatiable and will want to keep coming back to method S1 for more. Assume that there is no attempt by the application to safely terminate either T1 or T2, i. e. they are allowed to keep running. Required:
List ONE plausible sequence of thread states that T1 and T2 might go through, starting from the time they issue a wait(), as described above, up to the time when there will not be any more state changes.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, olorteguimikie
Which part of the cpu accepts data?
Answers: 1
image
Computers and Technology, 23.06.2019 07:00, bskyeb14579
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
image
Computers and Technology, 23.06.2019 17:00, taytay1828
What are the 12 colors of the spectrum called?
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, tanya44737
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
Class X has synchronized methods S1 and S2. Consider an instance xinstance of class X, consumer thre...

Questions in other subjects: