|
|
Start of Tutorial > Start of Trail |
Search
Feedback Form |
This is an applet that animates different sorting algorithms. No, this chapter is not about sorting algorithms. But these applets do provide a visual aid to understanding a powerful capability of the JavaTM platform—threads.
This chapter has been updated to reflect features and conventions of the latest release, JDK 5.0, but it is not yet final. We've published this preliminary version so you can get the most current information now, and so you can tell us (please!) about errors, omissions, or improvements we can make to this tutorial.
Bi-Directional Bubble Sort Bubble Sort Quick SortStart each of the applets, one by one, by clicking on them with the mouse. You can see each applet working its way through the data, sorting it, with shorter lines on top and longer lines on bottom. While the applets are sorting, also notice that you can scroll the page or bring up one of your browser’s panels. All this is due to threads.A thread—sometimes called an execution context or a lightweight process—is a single sequential flow of control within a program. You use threads to isolate tasks. When you run one of these sorting applets, it creates a thread that performs the sort operation. Each thread is a sequential flow of control within the same program (the browser). Each sort operation runs independently from the others but at the same time.
What Is a Thread?
Task Scheduling
Implementing the Runnable Interface
The Life Cycle of a Thread
Thread Scheduling
Synchronizing Threads
Thread Pools
Threads Summary
Questions and Exercises: Threads
|
|
Start of Tutorial > Start of Trail |
Search
Feedback Form |
Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.