Threaded Programs Code Samples
A thread is a path of execution through a program. Single threaded programs have one path of execution, and multi-threaded programs have two or more paths of execution. For most programs, one thread of execution is all you need, but sometimes it makes sense to use multiple threads in a program to accomplish multiple simultaneous tasks.
- Applet Examples
- Synchronization
Applet Examples
- SlideShow.java downloads three thumbnail paintings by Claude Monet and draws them one-by-one on the applet's panel. For supporting information see Creating a Threaded Slide Show Applet.
Synchronization
- Editor.java explains how to use the InvokeLater method and synchronize keyword to ensure data integrity when modifying data in Swing components. For supporting information see Multithreaded Swing Applications.
Comments (1)
Nov 04
andrewblogadino says:
Multi-threading and threaded program execution is such a complex idea. Can you p...Multi-threading and threaded program execution is such a complex idea. Can you possibly post more examples of synchronization and possibly show one program running single thread and the same program running multi in comparison? That would be awesome.