💟 process synchronization
process들 사이의 수행 시기를 맞추는 것
✔ 실행 순서 제어를 위한 synchronization
✔ mutual exclusion - Shared resource, critical section, race condition, Producer & consumer problem
*mutual exclusion을 위한 3가지 원칙: mutual exclusion, progress, bounded waiting
💟 mutex lock
lock, acquire, release
💟 semaphore
shared resource가 n개, wait, signal
💟 monitor
shared resource를 다루는 interface에 접근하기 위한 queue를 만들고, monitor 안에 하나의 process만 들어오도록 mutual exclusion을 위한 synchronization 제공
💟 Dining philosphers problem
💟 Deadlock 발생 조건
💟 Deadlock 해결방법
💟 Swapping
: process들을 임시로 보조기억장치 영역으로 쫓아내고, 빈 공간에 다른 process를 적재하여 실행하는 방식
*swap space(process들이 쫓겨나는 보조기억장치의 일부 영역), swap-out(memory→swap space), swap-in(swap space→memory)
💟 memory allocation
💟 external fragmentation
process 할당이 어려울 만큼 작은 memory 공간들로 인해 memory 낭비 → compaction(but overhead 발생) → paging
💟 Paging
process의 논리 주소 공간을 page라는 일정한 단위로 자르고, 메모리 물리 주소 공간을 frame이라는 page와 동일한 크기의 일정한 단위로 자른 뒤 page를 frame에 할당하는 가상 메모리 관리 기법
→ Paging 사용을 통해 physical memory보다 큰 process를 실행 가능해짐, external fragmentation도 해결가능
💟 Page table
page number와 frame number를 짝지어주는 표. CPU가 page number를 보고 해당 page가 적재된 frame을 찾을 수 있게 해준다.
*PTBR(page table base register): 각 process의 page table이 적재된 adrress를 가리킨다.
*TLB(Translation Lookaside Buffer): page table의 cache memory
→ TLB hit(logical address에 대한 page numbr가 TLB에 있을 때)
→ TLB miss(logical address에 대한 page numbr가 TLB에 없을 때) → 어쩔 수 없이 page가 적재된 frame을 알기 위해 memory 내의 page table에 접근
❣ logical address = page number + offset
💟 PTE(Page Table Entry)
valid bit : 해당 page에 접근 가능한가? (valid bit가 0인 memory에 적재되어 있지 않은 page로 접근 시 page fault라는 exception 발생)
protection bit : 해당 page가 read&write인가? read only인가?
reference bit : CPU가 해당 page에 접근한 적이 있는가?
modified bit(=dirty bit) : 해당 page에 data를 쓴 적이 있는가?
*copy on write, hierarchical paging, multilevel page table
💟 demand paging
→ Process를 memory에 적재할 때 필요한 page만 memory에 적재하는 기법
💟 Page Replacement Algorithm
💟 file
하드 디스크나 SSD와 같은 보조기억장치에 저장된 관련 정보의 집합
*metadata : data의 data
💟 Directory
tree structured directory
💟 Path