MIT 6 033 - Lecture 4: Client/server (5 pages)

Previewing pages 1, 2 of 5 page document View the full content.
View Full Document

Lecture 4: Client/server



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Lecture 4: Client/server

99 views

Lecture Notes


Pages:
5
School:
Massachusetts Institute of Technology
Course:
6 033 - Computer System Engineering
Computer System Engineering Documents

Unformatted text preview:

MIT OpenCourseWare http ocw mit edu 6 033 Computer System Engineering Spring 2009 For information about citing these materials or our Terms of Use visit http ocw mit edu terms 6 033 Lecture 4 Client server Modularity how to impose order on complex programs break into modules big Therac 25 blob components interactions goal decouple narrow set of interactions Modularity 2 what form does modularity take interactions are procedure calls C P P returns to C procedure clarifies interface hides implementation P a C y P x Enforced is the interface enforced is the implementation hidden What actually happens when C calls P 6 004 they communicate via a shared stack in memory stack regs args RA P s vars maybe args C push regs push args push PC 1 jmp P pop args pop regs R0 P push vars pop vars mov xx R0 pop PC Call Contract P returns P returns to where C said P restores stack pointer P doesn t modify stack or C s other memory P doesn t wedge machine e g use up all heap mem Soft modularity at a low level none of call contract is enforced want spec contract spec we cannot hope to enforce e g does sqrt return the right answer contract is purely mechanical we can try to enforce goal programmer need only worry about spec not contract Enforced Modularity there are many ways to enforce modularity we ll look at one today Client server note much of prob from sharing same machine and memory so put C and P on separate machines interact only w msgs diagram two boxes with a wire Examples web client server AFS X windows about to read Code time diagram Client put args in msg e g URL send msg wait for reply read result from reply Server wait for req msg get args compute put result in reply msg e g content of index html send reply goto start C S Benefits 1 protects control flow e g return address 2 protects private data 3 no fate sharing crashes and wedges don t propagate 4 forces a narrow spec for better or worse no global vars c s enforces most of call contract bugs can still propagate via



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Lecture 4: Client/server 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 Lecture 4: Client/server 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?