Question: Lab Problem: The code below attempts to implement an authentication protocol between two objects, called Boy and Gir1. The protocol is asynchronous and works as

 Lab Problem: The code below attempts to implement an authentication protocolbetween two objects, called Boy and Gir1. The protocol is asynchronous andworks as follows: each "pings" the other when the other is pinged,

Lab Problem: The code below attempts to implement an authentication protocol between two objects, called Boy and Gir1. The protocol is asynchronous and works as follows: each "pings" the other when the other is pinged, it responds with a "confirm When the code is executed the following is output Starting...1 Girl (ping): pinging Boy Boy (ping): pinging Girl due to a deadlock condition: both Boy and Girl are made to wait in ping and no one can invoke confirm. You may have to run the code several times before you see this Rework the code to get output that has both the girl and the boy etting confirmation an example looks like this starting.. .1 Girl (ping): pinging Boy Boy (ping) pinging Girl Girl (ping): asking Boy to confirm Boy (confirm): confirm to Girl Girl (ping): got confirmation Boy (ping) asking Girl to confirm Girl (confirm): confirm to Boy Boy (ping): got confirmation The girl and the boy must get confirmation on every run. Try not to blow this off by serializing the code (for example, do not have the Girl autheticate the Boy then have the Boy authenticate the Girl). Leave the ping and the confirm methods in the Monitor and do not change the Runner class except, maybe, to add a print statement

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!