[아이템 80] 스레드보다는 실행자, 태스크, 스트림을 애용하라
동시성 작업을 할 때는 작업 큐를 직접 생성할 수도 있겠지만 복잡한 작업들(안전실패, 응답불가 예방)이 필요하다. 때문에 java.util.concurrent 패키지의 실행자, 태스크, 스트림을 이용하는 편이 더 낫다. Executors 가 제공하는 정적팩터리 메서드를 사용하면 다양한 작업 큐를 얻을 수 있다. https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html Executors (Java Platform SE 7 ) Returns a thread factory used to create new threads that have the same permissions as the current thread. This fa..
Reading Record/이펙티브자바
2020. 7. 3.