Exercises
23.5 (True or False) State whether each of the following is true or false. If false, explain why.
a) Method sleep does not consume processor time while a thread sleeps.
b) Swing components are thread safe.
c) (Advanced) Declaring a method synchronized guarantees that deadlock cannot occur.
d) (Advanced) Once a ReentrantLock has been obtained by a thread, the ReentrantLock object will not allow another thread to obtain the lock until the first thread releases it.
23.6 (Multithreading Terms) Define each of the following terms.
a) thread
b) multithreading
c) runnable state
d) timed waiting state
e) preemptive scheduling
f) Runnable interface
g) producer/consumer relationship
h) quantum
23.7 (Advanced: Multithreading Terms) Discuss each ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access