Modern Concurrent Programming for Multicode Environment

동시성으로 작성하는 파이썬 크롤러

  • Kim, Nam-gue (Dept. of Information and Communication Engineering, Dongseo University) ;
  • Kang, Young-Jin (Dept. of Ubiquitous IT Graduate School of Dongseo University) ;
  • Lee, HoonJae (Dept. of Computer Engineering, Dongseo University)
  • 김남규 (동서대학교 컴퓨터공학부) ;
  • 강영진 (동서대학원 유비쿼터스 IT) ;
  • 이훈재 (동서대학교 컴퓨터공학부)
  • Published : 2017.05.31

Abstract

Programming that ensures concurrency is essential for developers. If you do not use it, it is hard to expect the speed of the program to improve unless there is technical advancement of the hardware itself. Programming languages that support good concurrency code include go, elixir, and scala. Python, which supports a number of useful libraries, also supports concurrent programming like asyncio and coroutine. This paper defines the concepts of concurrency and parallelism, and explains what to note when writing concurrency programming in Python. The crawler that collects web data is written in concurrent code and compared with programs written in sequential, multithreaded code.

동시성을 보장하는 프로그래밍은 개발자에게 있어서 필수적이다. 이를 사용하지 않는다면 하드웨어 자체의 기술 발전이 있지 않는 한 프로그램의 속도 향상을 기대하기 힘들다. 뛰어난 동시성 코드를 지원하는 프로그래밍 언어로 go, elixir, scala 등이 있다. 수많은 유용한 라이브러리를 지원하는 파이썬 역시 asyncio나 coroutine과 같은 동시성 프로그래밍을 지원하고 있다. 본 지에서는 동시성과 병렬성의 개념을 정의하며, 파이썬에서 동시성 프로그래밍을 작성할 시에 유의해야 할 점에 대해 설명한다. 웹 데이터를 수집하는 크롤러를 동시성 코드로 작성하여 순차, 멀티스레딩 코드로 작성된 프로그램과 성능을 비교한다.

Keywords