Lec9_mem

Lec9_mem - MidTerm Mistakes CSE120 Principles of Operating...

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

View Full Document Right Arrow Icon
1 CSE120 Principles of Operating Systems Prof Yuanyuan (YY) Zhou Lecture 9: Memory Management May 4th, 2011 MidTerm Mistakes Condition variable Can you do Condition c if ( c )…. Lock After a red thread acquire the lock, enter the critical section, can other red threads get in? So what’s the use of the lock in that question? To protect numRed and numBlue 5/4/2011 CSE 120 – Lecture 9 – Memory Management 2 Midterm Mistakes Is the following code correct? Is the following code correct? struct lock{ char held = ‘n’; char l; } acquire (struct lock lck) { lck->l = ‘y’ while(lck->l == ‘y’) swap (&(lck->l), &(lck->held)); } 5/4/2011 CSE 120 – Lecture 9 – Memory Management 3 Final Grade Combination of Midterm Projects Final exam Letter grades are based on relative performance, not absolute performance 5/4/2011 CSE 120 – Lecture 9 – Memory Management 4
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 5/4/2011 CSE 120 – Lecture 9 – Memory Management 5 Memory Management Next few lectures are going to cover memory management Goals of memory management To provide a convenient abstraction for programming To allocate scarce memory resources among competing processes to maximize performance with minimal overhead Mechanisms Physical and virtual addressing (1) Techniques: partitioning, paging, segmentation (1) Page table management, TLBs, VM tricks (2) Policies Page replacement algorithms (3) 5/4/2011 CSE 120 – Lecture 9 – Memory Management 6 Lecture Overview Virtual memory warm-and-fuzzy Survey techniques for implementing virtual memory Fixed and variable partitioning Paging Segmentation Focus on hardware support and lookup procedure Next lecture we’ll go into sharing, protection, efficient implementations, and other VM tricks and features 5/4/2011 CSE 120 – Lecture 9 – Memory Management 7 Virtual Memory The abstraction that the OS will provide for managing memory is virtual memory (VM) Virtual memory enables a program to execute with less than its complete data in physical memory A program can run on a machine with less memory than it “needs” Can also run on a machine with “too much” physical memory Many programs do not need all of their code and data at once (or ever) – no need to allocate memory for it OS will adjust amount of memory allocated to a process based upon its behavior VM requires hardware support and OS management algorithms to pull it off Let’s go back to the beginning… 5/4/2011 CSE 120 – Lecture 9 – Memory Management 8 In the beginning… Rewind to the days of “second-generation” computers Programs use physical addresses directly OS loads job, runs it, unloads it Multiprogramming changes all of this Want multiple processes in memory at once Overlap I/O and CPU of multiple jobs Can do it a number of ways Fixed and variable partitioning, paging, segmentation
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/26/2012 for the course CSE 120 taught by Professor Staff during the Spring '08 term at UCSD.

Page1 / 11

Lec9_mem - MidTerm Mistakes CSE120 Principles of Operating...

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

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