Threads
This directory contains the sample code from the Threads and Threading Issues
chapters.
This directory contains the following code:
-
PeriodicThread.java: The fire-every-n-seconds
Thread implementation. Also found in the javageeks.com library.
-
ScheduledThread.java: The fire-when-x-occurs
Thread implementation. Also found in the javageeks.com library.
-
ThreadExit.java: Class demonstrating the particular "hole"
in JDK 1.2 regarding the
Thread.exit()
method.
-
Wait.java: Demonstrates the fact that daemon threads do not keep
the JVM alive alone.
-
ExceptionableRunnable.java: This class
(erroringly listed as "ExceptionRunnable" in the text) implements the Exception-from-Runnable
idea suggested in section 6.2
-
ThreadGroupEx.java: The callback approach to exceptions-from-
Threads.
-
FutureThread.java: Thread idiom that fires a method call
asynchronously until a return value is requested, then blocks until the method call returns.