308-203A Introduction to Computing II Lecture 17: Programming with Threads in Java

11/22/00


Click here to start


Table of Contents

308-203A Introduction to Computing II Lecture 17: Programming with Threads in Java

Multi-tasking

Threads = Multi-tasking within a Program

Event-driven programming

Event-driven programming

A Bad Use of Threads

Creating threads in Java

An example

An example

An example

Race Conditions

Race Conditions

Sharing of data

Sharing of data

Data Hazards

Data Hazard - example

Data Hazard - example

Data Hazard - example

Data Hazard - example

Data Hazard - example

Data Hazard - example

Data Hazard - example

Mutual exclusion

Mutual exclusion in Java “synchronized”

Any questions?

Author: Alfred Holz

Email: wrenne@acm.org

Home Page: http://www.cs.mcgill.ca/~cs203