week - 09

deutan·2025년 5월 8일

PINTOS - Threads

PintOS Document

Assignment 1 - Alarm clock.

An alarm is a kernel internal function that restarts the calling process after a predetermined time interval.

devices/timer.c에 구현 된 timer_sleep() 함수 Busy waiting을 피하도록 재구현

Implementing "Sleep and Wake up"


Keyword

Busy waiting -> do empty loop waiting for entrying critical section

blocked queue -> if sem == 0
process do self-blocked and insert PCB in wait queue
if sem be positive
queue pop to ready queue

semaphore based on mutex(mutual exclusion)
semaphore can be mutex, can't converse.

  • binary semaphore(mutex) - single resource
  • counting semaphore - identical resources

mutex, semaphore usage in C
dining philosophers
consumer producer
Later....

Deadlock



Deadlock prevention with Banker's algorithm
Later...

Starvation

similar with Deadlock,
but status is ready
with poor priority

CPU Scheduling

Purpose

  • Maximize CPU utilization
  • Minimize response and waiting time of process

Scheduling Algorithm is deciding which process will own the CPU.

profile
Visual Computing and Learning

2개의 댓글

comment-user-thumbnail
2025년 5월 13일

잘 보고 갑니다~~~ :)

1개의 답글