CSCI 202: Object-Oriented Programming
Programs designed in class
Thread states |
- Creating and running threads:
- ... by extending the class Thread - ThreadDemo1a.java
- ... by implementing the interface Runnable - ThreadDemo1b.java
- Using the sleep() method: ThreadDemo2.java
- Interrupting threads: Interrupter.java
- Working with thread priority: ThreadDemo3.java
- Handling multiple threads
- Working with groups of threads: ThreadGroupDemo.java
- The Executor framework: ThreadPoolDemo.java
- Working with account deposits
- Unsynchronized deposits: AccountDemo1.java
- Unsynchronized deposits: AccountDemo2.java
- Synchronized deposits: AccountDemo3.java
- The deposit - withdraw "game"
- Asynchronous deposits and withdrow: AccountDemo4.java
- Cooperation between deposits and withdrow: AccountDemo5.java
- Applications of threads
- Suspending and resuming threads: StopWatch.java try it
- Talking clock ...
- ... with audio in one thread: Project AudioClock1
- ... with audio in a separate thread (warning!): Project AudioClock2
- ... with audio in a separate thread (works fine): Project AudioClock3
- Progress bar indicator: ProgressBar.java