Skip to Content
고성능 파이썬(2판)
book

고성능 파이썬(2판)

by 오현석, 미샤 고렐릭, 이안 오스발트
May 2021
Beginner to intermediate
528 pages
11h 27m
Korean
Hanbit Media, Inc.
Content preview from 고성능 파이썬(2판)
303
9
multiprocessing 모듈
NOTE
_ 여기서는 *
nix
기반 컴퓨터의
multiprocessing
을 논의한다(이번 장은 우분투
Ubuntu
를 사용해
작성했지만, 여기서 설명한 코드는 맥에서도 변경하지 않고 실행할 수 있다). 파이썬
3
.
4
이후로는 윈도우에서
이상하게 작동하던 부분도 잘 처리됐다.
Joblib
multiprocessing
보다 플랫폼 간 호환성을 더 잘 지원한
다. 따라서
Joblib
multiprocessing
보다 먼저 검토해 보기를 권장한다.
여기서부터는 이안의 노트북에 장착된 물리 코어의 개수에 맞춰서 프로세스의 개수를 하드코
딩해 고정한다 (
NUM
_
PROCESSES
=
4
). 기본적으로
multiprocessing
은 가능한 한 많은 코어를
활용할 것이다 (이안의 노트북에는
4
개의
CPU
4
개의 하이퍼스레드가 있어 총
8
개로 인식한
다). 특별히 자원을 구체적으로 관리하려는 의도가 아니라면, 일반적으로 프로세스의 수를 하
드코딩하지 말아야 한다.
9.1
multiprocessing
모듈 소개
multiprocessing
모듈은 프로세스와 스레드 기반의 병렬화를 위한 저수준 인터페이스를 제
공한다. 이 모듈의 주 구성 요소는 다음과 같다.
프로세스
Process
현재 프로세스를 포크
fork
한 복사본이다. 이렇게 하면 새로운 프로세스 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
견고한 데이터 엔지니어링

견고한 데이터 엔지니어링

조 라이스, 맷 하우슬리
핸즈온 비지도 학습

핸즈온 비지도 학습

강재원, 권재철, 안쿠르 A. 파텔

Publisher Resources

ISBN: 9791162244210