flâneur — a map of the web's best reading

CS111 Section 6: Preemption and Virtual Memory

web.stanford.edu · 739 words · saved by 1 readers

Clone the section starter code by using the command below. This command creates a section6 directory containing the project files. Next, pull up the online section checkoff and have it open in a browser so you can jot things down as you go. thread-cycle-preemption.cc is the same thread cycling program as last week's section, but using preemptive scheduling - meaning that every 0.5 seconds, it automatically yields the current thread to run the next one every time the timer fires, instead of the threads manually calling yield. The code has been updated so that all threads print forever, and are switched between whenever the timer fires. The main thread now does the following: The other threads now do the following: And the interrupt handler just calls yield: All other code is the same as from the prior section. Compile and run the program, and trace through the code to answer the following questions: Q1: When the program switches to executing thread one for the first time, where does it

CS111 Section 6: Preemption and Virtual Memory Section 6: Preemption and Virtual Memory --> Sections Wed Feb 26 to Sun Mar 02 Handout written by Nick Troccoli. Edits by Pratyush Agarwal. Learning Goals During this section, you will: review interrupts and how we enable/disable them as needed to implement preemptive scheduling get practice with the idea of virtual memory and virtual vs. physical addresses become more familiar with the "base and bound" approach to virtual memory Get Started Clone the section starter code by using the command below. This command creates a section6 directory contai

Explore this link on the map →

related reading