Multiple Choice
Class MyClass has two ReentrantLock objects, myLock1 and myLock2.Suppose thread one acquires myLock1 as it enters methodX and immediately completes its CPU time slice.After thread two enters methodY, it acquires myLock2 and tries to acquire myLock1.When thread one resumes, it tries to acquire myLock2.What will happen next?
A) Thread two will acquire myLock1
B) Thread one will acquire myLock2
C) Deadlock will occur
D) Thread two will release myLock2
Correct Answer:

Verified
Correct Answer:
Verified
Q44: When a thread is interrupted, the most
Q45: Insert the statement that would start the
Q46: Assume two threads share a BankAccount object
Q47: Consider an old fashioned telephone booth that
Q48: What should be done to get the
Q50: Which argument(s) present(s) the best case(s) for
Q51: In which method are the tasks that
Q52: Which of the following definitely indicates that
Q53: The term "starvation" means a situation where
Q54: _ allow a thread to temporarily release