CS-Oh-Yeahs / os_study

μš΄μ˜μ²΄μ œμ™€ μ •λ³΄κΈ°μˆ μ˜ 원리 μŠ€ν„°λ””
7 stars 1 forks source link

πŸ€” [CH07]Q1 Deadlock이 λ°œμƒν•˜λŠ” 4가지 쑰건에 λŒ€ν•΄ μ„€λͺ…ν•΄μ£Όμ„Έμš”. #63

Open dianestar opened 2 years ago

dianestar commented 2 years ago

i) ν•œ λ²ˆμ— ν•œ ν”„λ‘œμ„ΈμŠ€λ§Œμ΄ λ…μ μ μœΌλ‘œ μžμ›μ„ μ‚¬μš©ν•˜λŠ” Mutual Exclusion(μƒν˜Έλ°°μ œ), ii) ν”„λ‘œμ„ΈμŠ€κ°€ μžμ›μ„ 슀슀둜 λ‚΄λ†“λŠ” 것은 κ°€λŠ₯ν•˜μ§€λ§Œ κ°•μ œλ‘œ λΉΌμ•—κΈ°λŠ” 것은 λΆˆκ°€λŠ₯ν•œ No Preemption(비선점), iii) ν”„λ‘œμ„ΈμŠ€κ°€ μžμ‹ μ΄ 가진 μžμ›μ€ 내놓지 μ•ŠμœΌλ©΄μ„œ λ‹€λ₯Έ μžμ›μ„ μΆ”κ°€λ‘œ μš”μ²­ν•˜λŠ” Hold and Wait(λ³΄μœ λŒ€κΈ°), iv) μžμ›μ„ μš”μ²­ν•˜λŠ” ν”„λ‘œμ„ΈμŠ€λ“€ κ°„μ˜ 사이클이 ν˜•μ„±λ˜λŠ” Circular Wait(μˆœν™˜λŒ€κΈ°)κ°€ λ°λ“œλ½μ˜ 4가지 쑰건에 ν•΄λ‹Ήν•©λ‹ˆλ‹€.

gzgzg2 commented 2 years ago
  1. Mutual exelusion(μƒν˜Έλ°°μ œ) : 맀 μˆœκ°„ ν•˜λ‚˜μ˜ ν”„λ‘œμ„ΈμŠ€λ§Œμ΄ κ³΅μœ μžμ›μ„ μ‚¬μš©ν•˜λŠ” 것
  2. No Preemption(비선점) : ν”„λ‘œμ„ΈμŠ€κ°€ μžμ›μ„ 슀슀둜 λ°˜λ‚©ν•  뿐 뺏기지 μ•ŠλŠ” 것
  3. Hold and wait : μžμ‹ μ΄ 가지고 μžˆλŠ” μžμ›μ„ μ–‘λ³΄ν•˜μ§€ μ•Šκ³  λ‹€λ₯Έ ν”„λ‘œμ„ΈμŠ€κ°€ λ³΄μœ ν•œ μžμ›λ§Œμ„ κΈ°λ‹€λ¦¬λŠ” 것
  4. Circular wait : μžμ›μ„ κΈ°λ‹€λ¦¬λŠ” ν”„λ‘œμ„ΈμŠ€λ“€ 끼리 μ„œλ‘œ ν•„μš”λ‘œ ν•˜λŠ” μžμ›μ„ 가지고 μžˆμ–΄μ„œ cycle이 ν˜„μ„±λ˜λŠ” 것