A) Only I
B) Only II
C) Only III
D) I, II, or III
Correct Answer
verified
Multiple Choice
A) The bank account balances may no longer be correctly updated.
B) The printouts may become intermingled.
C) The printouts may no longer display the correct balances.
D) All of the above.
Correct Answer
verified
Multiple Choice
A) When multiple threads try to use the same shared data at the same time, and the threads become undone
B) When multiple threads copy the same shared data in order to proceed, consequently leaving the original lock object useless
C) When multiple threads intertwine multiple times and the lock object is lost, or unreachable
D) When multiple threads are not proceeding because they are currently waiting to acquire the same lock
Correct Answer
verified
Multiple Choice
A) Only I
B) Only II
C) I and III
D) II and III
Correct Answer
verified
Multiple Choice
A) 1,2,3,4,5,6,7,8
B) 1,2,2,4,5,6,7,8
C) 1,2,3,4,5,6,8,8
D) 1,2,3,4,5,6,8,7
Correct Answer
verified
Multiple Choice
A) The calls were interleaved: thread one, thread two, thread one, thread two, …
B) The first call was to the deposit method.
C) The last call was to the withdraw method.
D) Each individual call to the deposit and withdraw methods ran to completion.
Correct Answer
verified
Multiple Choice
A) The signalAll method is always more efficient
B) signal can lead to deadlocks when not every waiting thread is able to proceed
C) signalAll notifies the waiting threads that sufficient funds is absolutely available, while signal only notifies one at a time
D) None of the above
Correct Answer
verified
Multiple Choice
A) run
B) signal
C) await
D) interrupted
Correct Answer
verified
Multiple Choice
A) Thread two will wait for the lock.
B) Thread two will acquire the lock.
C) Deadlock will occur.
D) Thread two causes the IllegalStateMonitorException.
Correct Answer
verified
Multiple Choice
A) public Thread(Runnable r)
B) public Thread()
C) public Runnable(Thread t)
D) public Thread(String s)
Correct Answer
verified
Multiple Choice
A) $10
B) $20
C) $0
D) a negative amount
Correct Answer
verified
Multiple Choice
A) start
B) wait
C) await
D) sleep
Correct Answer
verified
Multiple Choice
A) Only I
B) Only II
C) Only III
D) I and III
Correct Answer
verified
Multiple Choice
A) 0
B) 15 or 25
C) 45
D) -5
Correct Answer
verified
Multiple Choice
A) Only I
B) I and II
C) I and III
D) I, II, and III
Correct Answer
verified
Multiple Choice
A) run
B) await
C) sleep
D) delay
Correct Answer
verified
Multiple Choice
A) increased sharing
B) mutual exclusion
C) speed increase
D) privacy protection
Correct Answer
verified
Multiple Choice
A) sleep makes the current thread wait and allows another thread to acquire the lock object while the await pauses the current thread for a set time
B) await makes the current thread wait and allows another thread to acquire the lock object while the sleep pauses the current thread for a set time
C) sleep handles the current thread while the await handles the next thread
D) sleep and await are the same
Correct Answer
verified
Multiple Choice
A) run1 and run2 execute as independent threads.
B) Syntax error
C) Only run1 executes as an independent thread.
D) run1 and run2 run sequentially, not as independent threads.
Correct Answer
verified
Multiple Choice
A) IOException
B) IllegalStateMonitorException
C) InterruptedException
D) SleepException
Correct Answer
verified
Showing 1 - 20 of 81
Related Exams