ReentrantLock 기본 비공정과 fair constructor

constructor 선택이 queue 선호와 처리 비용에 미치는 차이를 본다.

new ReentrantLock()

대기 순서를 보장하지 않고 barging 가능성을 허용한다

fair false

new ReentrantLock(true)

오래 기다린 queue 선두를 더 우선한다

fair true
측정 지표throughput과 p99·maximum wait를 함께 수집한다

핵심: fair mode도 thread start나 end-to-end 업무 순서를 완전히 보장하지 않는다.