Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Operating system Thread Lab work, Lab Reports of Operating Systems

Create a monitor with methods Hydrogen() and Oxygen(), which wait until a water molecule can be formed and then return. Do not worry about explicitly creating the water molecule; just wait until two hydrogen threads and one oxygen thread can be grouped together. For example, if one thread calls Oxygen, and then the second and third thread calls Hydrogen, the third thread should wake up the first thread and they should then all return. - Identify the correctness constraints of the problem - Specify the conditions that each method must wait for - Write down the shared state that you will use to check these conditions - Implement a solution using only one lock

Typology: Lab Reports

2022/2023

Uploaded on 10/13/2023

unknown user
unknown user 🇯🇲

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE 331
Operating Systems Design
Labwork 4 - Section 2
Building Water
Create a monitor with methods Hydrogen() and Oxygen(), which wait until a water molecule can
be formed and then return.
Do not worry about explicitly creating the water molecule; just wait until two hydrogen threads
and one oxygen thread can be grouped together.
For example, if one thread calls Oxygen, and then the second and third thread calls Hydrogen,
the third thread should wake up the first thread and they should then all return.
- Identify the correctness constraints of the problem
- Specify the conditions that each method must wait for
- Write down the shared state that you will use to check these conditions
- Implement a solution using only one lock

Partial preview of the text

Download Operating system Thread Lab work and more Lab Reports Operating Systems in PDF only on Docsity!

CSE 331

Operating Systems Design Labwork 4 - Section 2 Building Water Create a monitor with methods Hydrogen() and Oxygen(), which wait until a water molecule can be formed and then return. Do not worry about explicitly creating the water molecule; just wait until two hydrogen threads and one oxygen thread can be grouped together. For example, if one thread calls Oxygen, and then the second and third thread calls Hydrogen, the third thread should wake up the first thread and they should then all return.

  • Identify the correctness constraints of the problem
  • Specify the conditions that each method must wait for
  • Write down the shared state that you will use to check these conditions
  • Implement a solution using only one lock