동시 실행
*********

이 장에서 설명하는 모듈은 코드의 동시 실행을 지원합니다. 적절한 도구
선택은 실행할 작업(CPU 병목 대 IO 병목)과 선호하는 개발 스타일(이벤트
구동 협력적 다중작업 대 선점적 다중작업)에 따라 달라집니다. 다음은 개
요입니다:

* "threading" --- 스레드 기반 병렬 처리

  * 스레드 로컬 데이터

  * Thread 객체

  * Lock 객체

  * RLock 객체

  * Condition 객체

  * Semaphore 객체

    * "Semaphore" 예

  * Event 객체

  * Timer 객체

  * Barrier 객체

  * "with" 문으로 록, 조건 및 세마포어 사용하기

* "multiprocessing" --- 프로세스 기반 병렬 처리

  * 소개

    * "Process" 클래스

    * 컨텍스트 및 시작 방법

    * 프로세스 간 객체 교환

    * 프로세스 간 동기화

    * 프로세스 간 상태 공유

    * 작업자 풀 사용

  * 레퍼런스

    * "Process"와 예외

    * 파이프와 큐

    * 잡동사니

    * Connection 객체

    * 동기화 프리미티브

    * 공유 "ctypes" 객체

      * "multiprocessing.sharedctypes" 모듈

    * 관리자

      * 사용자 정의 관리자

      * 원격 관리자 사용하기

    * 프락시 객체

      * 정리

    * 프로세스 풀

    * 리스너와 클라이언트

      * 주소 형식

    * 인증 키

    * 로깅

    * "multiprocessing.dummy" 모듈

  * 프로그래밍 지침

    * 모든 시작 방법

    * *spawn* 과 *forkserver* 시작 방법

  * 예제

* "multiprocessing.shared_memory" --- 프로세스 간 직접 액세스를 위한
  공유 메모리를 제공합니다

* "concurrent" 패키지

* "concurrent.futures" --- 병렬 작업 실행하기

  * Executor 객체

  * ThreadPoolExecutor

    * ThreadPoolExecutor 예제

  * ProcessPoolExecutor

    * ProcessPoolExecutor 예제

  * Future 객체

  * 모듈 함수

  * 예외 클래스

* "subprocess" --- Subprocess management

  * Using the "subprocess" Module

    * Frequently Used Arguments

    * Popen Constructor

    * Exceptions

  * Security Considerations

  * Popen Objects

  * Windows Popen Helpers

    * Windows Constants

  * Older high-level API

  * Replacing Older Functions with the "subprocess" Module

    * Replacing **/bin/sh** shell command substitution

    * Replacing shell pipeline

    * Replacing "os.system()"

    * Replacing the "os.spawn" family

    * Replacing "os.popen()", "os.popen2()", "os.popen3()"

    * Replacing functions from the "popen2" module

  * Legacy Shell Invocation Functions

  * Notes

    * Converting an argument sequence to a string on Windows

* "sched" --- 이벤트 스케줄러

  * 스케줄러 객체

* "queue" --- 동기화된 큐 클래스

  * 큐 객체

  * SimpleQueue 객체

* "contextvars" --- 컨텍스트 변수

  * 컨텍스트 변수

  * 수동 컨텍스트 관리

  * asyncio 지원

다음은 위 서비스 중 일부에 대한 지원 모듈입니다:

* "_thread" --- 저수준 스레드 API

* "_dummy_thread" --- "_thread" 모듈의 드롭인 교체

* "dummy_threading" --- "threading" 모듈의 드롭인 교체
