{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture22Full - COP 4600 Operating Systems Fall 2010 Click...

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

View Full Document Right Arrow Icon
Click to edit Master subtitle style 8/1/11 Lecture 22 COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM
Image of page 1

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

View Full Document Right Arrow Icon
Lecture 22 8/1/11 n Last time: n Presentation of the paper “Programming with Threads” by Andrew Birell n Thread coordination with a bounded buffer. ¨ WAIT ¨ NOTIFY n Today: n Thread coordination with a bounded buffer. ¨ AWAIT ¨ ADVANCE ¨ SEQUENCE ¨ TICKET n Semaphores n Deadlock and Wait for Graphs n Enforced modularity on the Intel x86 architecture n Virtual Machines n Next Time ¨ Scheduling Algorithms Lecture 22 – Thursday November 4, 2010 22
Image of page 2
Lecture 22 8/1/11 Coordination with bounded buffer n WAIT and NOTIFY can be used to coordinate the SEND and RECIVE systems calls. n This solution creates problems when a NOTIFY is sent before the WAIT. The thread in the WAITING state will never wake up. 33
Image of page 3

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

View Full Document Right Arrow Icon
Lecture 22 8/1/11 44 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 0 integer out initially 0 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
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern