Skip to content

This project enhances PintOS by replacing busy wait loops with an alarm clock mechanism, reducing CPU usage and improving system efficiency by allowing processes to sleep until needed without consuming resources.

License

Notifications You must be signed in to change notification settings

Sofia-Saraiva/PintOS-AlarmClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⏰ PintOS Project: Solving Busy Wait with Alarm Clock

πŸ“„ Description

This project enhances PintOS by replacing busy wait loops with an alarm clock mechanism, reducing CPU usage and improving system efficiency by allowing processes to sleep until needed without consuming resources.

πŸ›  2.2.2 Alarm Clock

πŸ”§ Modified Files and Functions

  • threads/thread.c:
    • Functions:
      • thread_init()
  • devices/timer.c:
    • Functions:
      • timer_sleep()
      • timer_interrupt()

πŸ“ Implementation Details

  • Data Structures: Implemented an ordered list of timer events, each with an expiration time and a reference to the process to be awakened.
  • Functionality: Added functions to initialize the alarm clock, add timer events, and handle expired events.
  • Scheduler Integration: Modified the scheduler to integrate with the new alarm clock mechanism.

πŸ§ͺ Testing on Pint-OS after compiling the code with changes

pintos -- -q run alarm-multiple

πŸ“œ License

This project is licensed under the MIT License.

About

This project enhances PintOS by replacing busy wait loops with an alarm clock mechanism, reducing CPU usage and improving system efficiency by allowing processes to sleep until needed without consuming resources.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages