Concurrency: Java Threads
(lectures programs)
Sun OnLine Documentations
Chapter 13
Multiple Threads
Basics
A very simple threading example:
SimpleThread:
Run applet
Create many threads:
Counter4
Blocking
Interrupting a blocked thread:
Interrupt
Stopping a thread:
Stop
Notifying a blocked thread:
Suspend
Priorities
Changing the priorities of threads:
SimplePriority
Sharing
Problems with resource sharing while threading:
Sharing1
Using the synchronized keyword to prevent multiple access to a particular resource:
Sharing2
Using the synchronized keyword in a different place:
Sharing2m