Lecture21

Lecture21 - Click to edit Master subtitle style 8/1/11...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style 8/1/11 Lecture 21 COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM Lecture 21 8/1/11 n Last time: n Discussion of the solutions for the midterm n Today: n Presentation of the paper Distributed object model of Java n Thread coordination with a bounded buffer. n Semaphores n Virtual memory Next time n Presentation of the paper Cooperating sequential processes n Virtual memory Lecture 21 Tuesday November 2, 2010 Lecture 21 22 Lecture 21 8/1/11 1 2 N-1 N-2 out in Read from the buffer location pointed by out Write to the buffer location pointed by out shared structure buffer message instance message[N] integer in initially integer out initially procedure SEND (buffer reference p, message instance msg) while p.in p.out = N do nothing /* if buffer full wait p.message [p.in modulo N] msg /* insert message into buffer cell p.in p.in + 1 /* increment pointer to next free cell procedure RECEIVE (buffer reference p) while p.in = p.out do nothing /* if buffer empty wait for message msg p.message [p.in modulo N] /* copy message from buffer cell p.out p.out + 1 /* increment pointer to next message return msg 1 Lecture 21 33 Lecture 21 8/1/11 Implicit assumptions for the correctness of the implementation 1. One sending and one receiving thread. Only one thread updates each shared variable....
View Full Document

Page1 / 20

Lecture21 - Click to edit Master subtitle style 8/1/11...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online