Java Threads
Java Threads
Java thread
start() resume()
new Thread(…)
not-running thread t terminates
(ready) sleep done
o.notify(), o.notifyAll()
interrupt()
(set bit) interrupt()
yield(), or
preempted scheduled
by JVM (throw exception)
by JVM
o.wait()
sleep(…)
running t.join()
stop(),
terminated suspend()
run() exits
normally or blocked by lock
abnormally
FIFTH EXAMPLE:
Threads can be put to
sleep, suspended and
resumed and stopped
...
...
...