Computer Science for Transfers
Lab 6 - The Bridge Troll
Overview
The primary purpose of this lab is get to provide you with the
opportunity to work with threads in Java. You will learn how to write
code that uses threads and how to modify the priority of a thread, as
well as techniques for controlling the
synchronization between running multiple threads.
Pre-lab
- Review your class notes on thread synchronization.
- Read through the
Java tutorial's section on thread synchronization.
Objectives
- Understand the concept of threads.
- Learn the Java syntax for defining, creating, and running threads.
- Execute programs that use threads.
- Understand the need for synchronization between multiple threads.
- Program using Java's thread synchronization primitives.
Activities
- Create n threads.
- Simulate a bunch of Woolies
- Controlling access to the bridge
Grading
| In-lab participation |
3 points |
| Activity 1 |
7 points |
| Activity 2 |
10 points |
| Activity 3 |
10 points |
| Total |
30 points |
Last modified July 24, 2003 by tmh.
All rights reserved.