Summary of Threads

Code Samples

Table 45 lists the code samples used in this chapter and where you can find the code online and on the CD that accompanies this book.

Table 45. Code Samples in Threads: Doing Two or More Tasks at Once

Code Sample

CD Location

Online Location

Reminder.java (page 273)

JavaTutorial/essential/threads/example-1dot3/Reminder.java

http://java.sun.com/docs/books/tutorial/essential/threads/example-1dot3/Reminder.java

ReminderBeep.java (page 275)

JavaTutorial/essential/threads/example-1dot3/ReminderBeep.java

http://java.sun.com/docs/books/tutorial/essential/threads/example-1dot3/ReminderBeep.java

AnnoyingBeep.java (page 276), (page 309)

JavaTutorial/essential/threads/example-1dot3/AnnoyingBeep.java

http://java.sun.com/docs/books/tutorial/essential/threads/example-1dot3/AnnoyingBeep.java

RaceApplet.java (page 287)

JavaTutorial/essential/threads/example-swing/RaceApplet.java

http://java.sun.com/docs/books/tutorial/essential/threads/example-swing/RaceApplet.java

Runner.java (page 287)

JavaTutorial/essential/threads/example-swing/Runner.java

http://java.sun.com/docs/books/tutorial/essential/threads/example-swing/Runner.java

RaceDemo.java (page 289), (page 309)

JavaTutorial/essential/threads/example/RaceDemo.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/RaceDemo.java

Producer.java (page 292)

JavaTutorial/essential/threads/example/Producer.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/Producer.java

Cubbyhole.java (page 292)

JavaTutorial/essential/threads/example/Cubbyhole.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/Cubbyhole.java

Consumer.java (page 292)

JavaTutorial/essential/threads/example/Consumer.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/Consumer.java

ProducerConsumerDemo.java (page 298)

JavaTutorial/essential/threads/example/ProducerConsumerDemo.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/ProducerConsumerDemo.java

TwoThreadsDemo.java (page 309)

JavaTutorial/essential/threads/example/TwoThreadsDemo.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/TwoThreadsDemo.java

SimpleThread.java (page 309)

JavaTutorial/essential/threads/example/SimpleThread.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/SimpleThread.java

SelfishRunner.java (page 309)

JavaTutorial/essential/threads/example/SelfishRunner.java

http://java.sun.com/docs/books/tutorial/essential/threads/example/SelfishRunner.java

Note

The section Common Problems and Their Solutions (page 391) contains solutions to common problems Tutorial readers have encountered.

Категории