multiprocessing
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| multiprocessing [2021/02/16 15:07] – rex8312 | multiprocessing [2024/03/23 02:38] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== multiprocessing ====== | ====== multiprocessing ====== | ||
| - | |||
| - | * Uber Fiber | ||
| - | * https:// | ||
| - | * multiprocessing과 사용법이 동일한 분산 컴퓨팅 | ||
| - | |||
| - | * loky: resuable pool executer | ||
| - | * https:// | ||
| - | |||
| - | * Array 공유 | ||
| - | * https:// | ||
| - | |||
| * 자식프로세스 출력 redirection | * 자식프로세스 출력 redirection | ||
| 줄 32: | 줄 21: | ||
| # https:// | # https:// | ||
| </ | </ | ||
| + | |||
| + | <code python> | ||
| + | original_stdout = sys.stdout | ||
| + | buffer = deque(maxlen=128) | ||
| + | |||
| + | class IOLoggerWrapper(io.StringIO): | ||
| + | def write(self, string): | ||
| + | buffer.append(string) | ||
| + | return len(string) | ||
| + | | ||
| + | root = logging.getLogger() | ||
| + | handler = logging.StreamHandler(IOLoggerWrapper()) | ||
| + | formatter = logging.Formatter(" | ||
| + | handler.setFormatter(formatter) | ||
| + | root.addHander(handler) | ||
| + | |||
| + | class IOWrapper(io.StringIO): | ||
| + | def write(self, string): | ||
| + | original_stdout.write(string) | ||
| + | buffer.append(string) | ||
| + | return len(string) | ||
| + | | ||
| + | io_wrapper = IOWrapper() | ||
| + | sys.stdout = io_wrapper | ||
| + | sys.stderr = io_wrapper | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== multiprocessing 대체 모듈 ===== | ||
| + | |||
| + | * Uber Fiber | ||
| + | * https:// | ||
| + | * multiprocessing과 사용법이 동일한 분산 컴퓨팅 | ||
| + | |||
| + | * loky: resuable pool executer | ||
| + | * https:// | ||
| + | |||
| + | * Array 공유 | ||
| + | * https:// | ||
| + | |||
multiprocessing.1613488029.txt.gz · 마지막으로 수정됨: (바깥 편집)