DOC PREVIEW
MIT 6 033 - Client and Server within a Computer and Concurrency

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

6.033 Spring 2009 Robert Morris Lecture 6 Client / Server within a Computer and ConcurrencyBounded Buffer Send send(p, m): while true: if p.in - p.out < N: p.buffer[p.in mod N]  m p.in  p.in + 1 returnBounded Buffer Receive receive(p): while true: if p.out < p.in: m  p.buffer[p.out mod N] p.out  p.out + 1 return msend(p, m): while true: if p.in - p.out < N: p.buffer[p.in mod N]  m p.in  p.in + 1 return receive(p): while true: if p.out < p.in: m  p.buffer[p.out mod N] p.out  p.out + 1 return mSend with Locking send(p, m): while true: acquire(p.lock) if p.in - p.out < N: p.buffer[p.in mod N]  m p.in  p.in + 1 release(p.lock) return release(p.lock)Does this work? send(p, m): while true: acquire(p.lock) if p.in - p.out < N: acquire(p.lock) p.buffer[p.in mod N]  m p.in  p.in + 1 release(p.lock) return


View Full Document

MIT 6 033 - Client and Server within a Computer and Concurrency

Documents in this Course
TRIPLET

TRIPLET

12 pages

End Layer

End Layer

11 pages

Quiz 1

Quiz 1

4 pages

Threads

Threads

18 pages

Quiz I

Quiz I

15 pages

Atomicity

Atomicity

10 pages

QUIZ I

QUIZ I

7 pages

Load more
Download Client and Server within a Computer and Concurrency
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Client and Server within a Computer and Concurrency and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Client and Server within a Computer and Concurrency 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?