How to streamline your life (lessons from computer architecture).COS 1164/1/2008Instructor: Sanjeev AroraLesson 1: Caching(and the 80-20 rule)The Tired Librarian1000 checkouts/returns per dayDistance covered = 50 x 2 x 1000 = 100,000 feet ~ 20 milesPlease help!!!Reserves50 ft80-20 “Rule”Pareto [1906]: 20% of the people own 80% of the wealthJuran [1930’s]: 20% of the organization does 80% of the workBetter ArrangementDistance covered per day?Reserves“Most popular” shelf: 20% most popular books5 ft50 ftEven better arrangement?Distance covered per day?Reserves“Most popular” shelf: 20% most popular books5 ft50 ftTop 4%Is the librarian’s problem solved?Discussion TimeHow to predict the 20% most popular books for next day?In general, no easy solutionIn practice, use rules of thumbExample: “Least Recently Used”. When you need to create space on the desk (or shelf), move out the book that was used least recentlyMany others (LRU is computationally expensive)New and improvedConnection to Computer OrganizationSpeed vs cost of various memories1540000On-chip memory for CPU (L2 Cache)5100RAM1 0.50Hard driveSpeed: GB/sCost: $ / GBLibrarian arrangementReserves“Most popular” shelf: 20% most popular booksDiskMemoryCacheTop 4%CPUComputerOften, today’s computers have even more levels of cachingMoralPerformance:Speed is close to that of fastest memory (cache)Overall capacity is that of largest memory (disk)QuestionHow does the same program (.exe file) run on different PCs with different memory configurations?Answer: “Virtual Memory”All programs live a fiction: allowed to pretend it has 264 bytes of memoryIllusion is preserved by hardwareGoodbye Lenin"The German Democratic Republic lives on – in 79 m²!" (Die DDR lebt weiter – auf 79 qm!)Program’s view:Underlying truth:Virtual MemoryPowerpointMemory:Address 0 Address 264 - 1Lec15.ppt P ≠ NP.pptLesson 2:Multitasking“The Multitasking Generation”An Evening’s Tasks for a Gen-M’erHomeworkListen to musicInstant MessagingCall Mom (goes to bed by 11 PM!)Answer phoneRead a bit more of Joyce’s UlyssesWatch the Daily ShowHow do you do it all?Scheduler’s objectivesFairnessTimelinessCritical tasks processed promptlyLow overhead How can one achieve these (often conflicting) goals?Discussion TimeTasks done by my PC last nightWord processingPlay CDDownload news updatesDownload emailRun clockHidden tasks: handle network traffic, manage disk and RAM traffic, scheduler, etc.Managed by “Operating System”(WinXP, Linux, MacOS, etc.)Multitasking versus Parallel ProcessingMultitasking: A single CPU handles manytasks by switching rapidly among them. (e.g., all Wintel machines since early 1990s;all Unix machines since the 1970s)Parallel Processing: Multiple CPUs that do thework of a single CPU. (But, 4 CPUs do notnecessarily mean 4x speed.)One main point studied by the judge: What is an OS?The Legal
View Full Document