Java - Process Synchronization

beccachan
COMP3411_Assignment5.pdf

COMP 3411: Operating Systems 1

TRU Open Learning

Assignment 5 – Process Synchronization (8%)

Introduction

Assignment 5 contributes 8% towards your final course grade and the assignment

total is 10 marks. You should begin Assignment five after completing the materials

in Module 6; it is due at the end of Module 8. Check your Course Schedule for the

precise due date. Directions for submitting Assignment 5 to your Open Learning

Faculty Member for grading can be found in the Assignments Overview tab. An

assignment marking criteria and your assignment submission details follows at the

end of this document.

Instructions

In this assignment, you will write a Java program that implements the solution to

the bounded buffer problem between a producer and a consumer. The producer will

produce forever and the consumer will consume forever. The producer will put data

into the buffer and the consumer will remove data from the buffer. The buffer must

implement a means of ensuring that the buffer never enters an under flow (take too

much data out) or over flow put too much data into the buffer. Additionally the

buffer must have functionality so that a critical region problem does not occur with

parallel updates to the data.

Test you application by creating a java thread for the produce, the consumer and

having them access a shared buffer with declared size 5. Refer back to assignment 3

to help set up the solution to this assignment.

Report Submission Details

You must submit Java files and screen shots that show how your program

works. Refer to the marking criteria at the end of this document.

2 Assignment 5

TRU Open Learning

Assignment Marking Criteria Weighting

No syntax error: All requirements are fully implemented without syntax

errors. Submitted screen shots will be reviewed with source code. /5

Correct implementation: All requirements are correctly implemented

and produce correct results Submitted screen shots will be reviewed

with source code.

/5

Total /10