자바의 정석 - 13.8 쓰레드 실행제어
13.8.1 실행제어 생성 → 실행대기 : start() 실행대기 → 실행 실행 → 소멸 : stop() 실행 → 실행대기 : yield() 실행 → 일시정지 : suspend(), sleep(), wait(), join(), I/O block 일시정지 → 실행대기 : time-out, resume(), notify(), interrupt() resume(), stop(), suspend()는 교착상태 문제 때문에 deprecated됨 13.8.2 sleep(long millis) 일정시간동안 쓰레드 정지 예외처리를 해 주어야함(메서드 생성시 편리함) void delay(long millis){ try{ Thread.sleep(1, 500000); }catch(InterruptedException e){..
더보기