The operators P and V - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

The operators P and V

Description:

The operators P and V. P (request) P (sem) Sem - - If Sem 0. Block on Sem. V (sem) Sem If Sem =0. Wake up next process. Types of Semaphores ... – PowerPoint PPT presentation

Number of Views:10
Avg rating:3.0/5.0
Slides: 5
Provided by: sall69
Category:
Tags: henry | operators

less

Transcript and Presenter's Notes

Title: The operators P and V


1
The operators P and V
  • P (request)
  • P (sem)
  • Sem - -
  • If Sem lt 0
  • Block on Sem
  • V (sem)
  • Sem
  • If Sem lt 0
  • Wake up next process

2
Types of Semaphores
  • Binary semaphore maximum value of 1
  • Counting semaphore maximum value other than 1

3
Producer/Consumer Problem
  • Set of 10 buffers
  • Producer fills a buffer with information
  • Consumer empties the buffer when it is full

4
Producer/Consumer Problem
  • Producer
  • P (empty)
  • P (mutex)
  • ltCSgt
  • V (mutex)
  • V (full)
  • Consumer
  • P (full)
  • P (mutex)
  • ltCSgt
  • V (mutex)
  • V (empty)
Write a Comment
User Comments (0)
About PowerShow.com