Chapter 8 summary
Concurrent processes contain two, or more, independently executing threads.
The Java
Thread
class can be extended to implement an application specific thread.
When a
Thread
's
start
() action is called it causes the instance's
run
() action to be started in a concurrent manner.
Actions, or parts of actions, can be made "thread safe" by declaring them as
synchronized
A running
Thread
can be temporarily stopped by calling its
suspend
() action and restarted by calling its
resume
() action.
A
Thread
can be suspended for a period of time by calling its
sleep
() action.
Two or more threads can co-ordinate their actions by suspending and resuming each other.
Concurrent programs require much more care in their design than non-concurrent programs and are subject to a number of very elusive bugs.
Exercises for Chapter 8
.
8.4 Problems with concurrency
.