Efficient Alarm Clock | CS 162 Project 2
timer_sleep is useful for threads that operate in real-time (e.g. for blinking the cursor once per second). The current implementation of timer_sleep is inefficient, because it calls thread_yield in a loop until enough time has passed. This consumes CPU cycles while the thread is waiting. Your task is to reimplement timer_sleep so that it executes efficiently without any busy waiting. Back to top Copyright © 2022 CS 162 staff.
Efficient Alarm Clock | CS 162 Project 2 Skip to main content Menu Expand (external link) Document Search Copy Copied CS 162 Project 2 Efficient Alarm Clock In Pintos, threads may call this function to put themselves to sleep: /** * This function suspends execution of the calling thread until time has * advanced by at least x timer ticks. Unless the system is otherwise idle, the * thread need not wake up after exactly x ticks. Just put it on the ready queue * after they have waited for the right number of ticks. The argument to * timer_sleep() is expressed in timer ticks, not in milliseconds o
Explore this link on the map →related reading
- Measuring Mutexes, Spinlocks and how Bad the Linux Scheduler Really is | Probably Danceprobablydance.com
- Introduction to Real-time Systemsdesign.ros2.org
- abseil / Performance Hintsabseil.io
- Writing a task scheduler in Zigopenmymind.net
- Concurrency Patterns in Embedded Rust - Ferrous Systemsferrous-systems.com
- Slice Dat Time | Putting the "You" in CPUcpu.land
- Multi Core Programming and Threadsimomath.com
- STRML: Chrome 56 Will Aggressively Throttle Background Tabsblog.strml.net
- Python time.time() vs time.perf_counter() – SuperFastPythonsuperfastpython.com
- GitHub - stanford-cs149/asst2: Stanford CS149 -- Assignment 2 · GitHubgithub.com
- Measuring Time: From Java to Kernel and back - JVM Adventjavaadvent.com
- Spinlocks Considered Harmfulmatklad.github.io