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 ...
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.