# System Programming
# EX4.2 - File RW lock handling
ATM μμ μ½λ
ATM command (c/r/d/q)
c : create
r : read
d : deposit
q : quit
w : withdraw
t : transfer
Withdraw
- Depositκ³Ό μ μ¬νκ² κ΅¬ν
- writer's lock μ΄μ©
- balance κ°μ μμ²νλ μΆκΈ κΈμ‘λ§νΌ κ°μ ν unlock
Transfer
- withdraw + deposit μμΌλ‘ μ§ν
- μΆκΈ κ³μ’ λ° μκΈ κ³μ’μ writer's lock
- μΆκΈ κ³μ’ (μ‘κΈνλ κ³μ’)μμ withdraw ν μ κΈ κ³μ’ (μ‘κΈλ°λ κ³μ’)μμ deposit
- λͺ¨λ μμ ν unlock
β System Programming fopen() ν¨μ β