lec04-readerwriter - CS162 Operating Systems and Systems...

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

View Full Document Right Arrow Icon
CS162 Operating Systems and Systems Programming Lecture 4 Synchronization, Atomic operations, Locks January 30, 2012 Anthony D. Joseph and Ion Stoica http://inst.eecs.berkeley.edu/~cs162
Background image of page 1

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

View Full DocumentRight Arrow Icon
Lec 4.2 1/30/12 Anthony D. Joseph and Ion Stoica CS162 ©UCB Spring 2012 Space Shuttle Example Original Space Shuttle launch aborted 20 minutes before scheduled launch Shuttle has five computers: Four run the “Primary Avionics Software System” (PASS) » Asynchronous and real-time » Runs all of the control systems » Results synchronized and compared 440 times per second The Fifth computer is the “Backup Flight System” (BFS) » Stays synchronized in case it is needed » Written by completely different team than PASS Countdown aborted because BFS disagreed with PASS A 1/67 chance that PASS was out of sync one cycle Bug due to modifications in initialization code of PASS » A delayed init request placed into timer queue » As a result, timer queue not empty at expected time to force use of hardware clock Bug not found during extensive simulation PASS BFS
Background image of page 2
Lec 4.3 1/30/12 Anthony D. Joseph and Ion Stoica CS162 ©UCB Spring 2012 Concurrency Multiple computations (threads) executing in parallel to share resources, and/or share data Share resources: high utilization Share data: enable cooperation between apps, e.g., Browser sharing data with OS to send/receive packets Web server: thread master sharing work & results with thread pool (see previous lecture) Powerpoint sharing data with Excel and Word
Background image of page 3

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

View Full DocumentRight Arrow Icon
Lec 4.4 1/30/12 Anthony D. Joseph and Ion Stoica CS162 ©UCB Spring 2012 Challenges Applications/programmers would like a system to behave as they were the only one using it (e.g., VM abstraction) Performance isolation and predictability Outputs should be consistent with application semantics E.g., depositing $100 and then another $100 to your bank account should always increase your balance by $200
Background image of page 4
Lec 4.5 1/30/12 Anthony D. Joseph and Ion Stoica CS162 ©UCB Spring 2012 Sharing Granularity Fine grain sharing: increase concurrency better performance more complex Coarse grain sharing: Simpler to implement Lower performance Examples: Sharing CPU for 10ms vs. 1min Sharing a database at the row vs. table granularity A single query can access a row/table at a time Allow one person vs. multiple persons in a supermarket!
Background image of page 5

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

View Full DocumentRight Arrow Icon
Lec 4.6 1/30/12 Anthony D. Joseph and Ion Stoica CS162 ©UCB Spring 2012 Goals for Today Synchronization Hardware Support for Synchronization Note: Some slides and/or pictures in the following are adapted from slides ©2005 Silberschatz, Galvin, and Gagne adapted from slides ©2005 Silberschatz, Galvin, and Gagne. Many slides generated by Kubiatowicz.
Background image of page 6
Lec 4.7 1/30/12 Anthony D. Joseph and Ion Stoica CS162 ©UCB Spring 2012 Motivation: “Too much milk” Great thing about OS’s – analogy between problems in OS and problems in real life Help you understand real life problems better But, computers are much stupider than people
Background image of page 7

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

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

This note was uploaded on 03/12/2012 for the course CS 162 taught by Professor Kubiatowicz during the Spring '02 term at University of California, Berkeley.

Page1 / 35

lec04-readerwriter - CS162 Operating Systems and Systems...

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

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