Concurrent Programming Using Java Threads
1. Motivation
- Efficiency
- Downloading network data files.
- Convenience
- Object-oriented simulation system.
- New Capabilities
2. Caution
- Significantly harder to debug and maintain.
3. Two Main Approaches:
- Make a self-contained subclass of
Thread
with the behavior
you want.
- Implement the
Runnable
interface and put behavior in the
run method of that object.