실제 현장이나 프로덕션 시스템에서는 외부와 통신해야 할 때가 많다. 이런 외부의 대상은 다
른 서버의 데이터베이스, 다른 작업 컴퓨터, 처리할 데이터를 제공하는 데이터 서비스 등이다.
이때 여러분의 문제는 곧장
I
/
O
위주로 바뀌곤 한다. 즉 실행 시간 대부분이 입력/출력을 처리
하는 데 소요된다.
동시성을 사용하면 여러
I
/
O
연산 사이에 계산을 끼워 넣음으로써
I
/
O
위주의 문제를 해결할
수 있다. 동시성은
I
/
O
와
CPU
연산 사이의 근본적인 차이를 공략해 전체 실행 시간을 줄여
준다.
298
고성능 파이썬(2판)
앞서 살펴본 것처럼,
gevent
는 비동기
I
/
O
를 위한 가장 높은 수준의 인터페이스를 제공한
다. 반면
tornado
와
aiohttp
를 사용하면 비동기
I
/
O
스택을 직접 제어할 수 있다. 서로 다
른 수준의 추상화와 더불어, 각 라이브러리는 서로 다른 문법 패러다임을 사용한다. 하지만
asyncio
는 비동기 해법을 하나로 묶는 접착제이며, 이 모두를 제어할 수 있는 토대를 제공 ...
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.
O’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
I 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
I’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
I'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.