Consider an old fashioned telephone booth that can be occupied by one person at a time. Suppose one person went in and dialed a part of her number, and had to leave the booth. A second person went in and dialed a part of his number, and before the number was fully dialed, a connection to some other phone was made. What Java threads analogy would prevent this undesirable scenario?
I Acquire the lock prior to entering the booth
II Dial a complete number when inside the booth
III Hang up the phone and release the lock upon exiting the booth
A) I
B) I and II
C) I and III
D) I, II and III
Correct Answer:
Verified
Q55: The _ method is called by a
Q56: Examine the SharedData class shown below. Suppose
Q57: Examine the SharedData class shown below. Suppose
Q58: Examine the SharedData class shown below. Suppose
Q60: Examine the SharedData class shown below. Suppose
Q60: Which phrase best describes the purpose of
Q62: Assume three threads share a BankAccount object
Q64: Stale data occurs in multi-CPU machines when
Q68: What happens when a thread calls the
Q71: Class MyClass has a single ReentrantLock object,
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents