반응형 Priority scheduling2 [pintos] Project1:Threads - Priority Scheduling (2) priority preemptive scheduling에 이어서 priority inversion을 해결하기 위해 priority donation을 구현해야한다. priority inversion pintos manual과 교재의 설명을 참고해 정리하면 H, M, L로 priority가 낮아지는 세 프로세스가 있고 priority scheduling을 따라 프로세스가 실행되면 H, M, L, 순서로 실행이 끝나야 한다. 하지만 아닌 경우가 발생하는데 이때 priority inversion이 발생했다고 한다. 만약 H가 L에 점유되어 있는 lock을 기다려야 하는 상황이 생겼다고 가정하자. H는 L이 lock을 풀어줄 때까지 CPU를 점유하지 못하고 waiting 상태에 놓인다. L이 lock을 풀어주는 .. 2022. 12. 9. [pintos] Project1:Threads - Priority Scheduling (1) 기존의 pintos의 경우 Round Robin 기법으로 priority에 상관없이 ready_list에 들어온 순서대로 프로세스들이 일정 시간동안 돌아가며 실행된다. 여기에 이제 priority를 고려해 priority가 높은 process부터 일정 시간동안 실행될 수 있도록 Priority Scheduling을 추가할 예정이다. 핀토스 메뉴얼에 따르면 Priority Scheduling을 위해 구현해야 할 내용은 아래와 같다. priority preemptive scheduling lock, semaphore, condition variable에서 깨어날 때 priority가 제일 높은 thread가 먼저 깨어나야 함 priority donation priority preemptive scheduli.. 2022. 12. 9. 이전 1 다음 728x90