는 동시성 버전을 구현할 때 중복을 피하고자 이 코드를 하나의 라이브러리로 사용했다. 이제
concurrent.futures
를 이용해서 다시 구현해 보자.
20
.
2
.
2
concurrent
.
futures
로 내려받기
concurrent.futures
패키지의 가장 큰 특징은
ThreadPoolExecutor
와
ProcessPoolExecutor
클래스다. 이 클래스들은 콜러블 객체를 서로 다른 스레드나 프로세스에서 실행하게 해 주는
API
를 구현한다. 이 클래스들은 작업자 스레드나 작업자 프로세스 풀과 실행할 작업을 분배하
고 결과를 수집할 큐를 투명하게 관리한다. 그러나
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.