1 Getting to know asyncio

This chapter covers

  • What asyncio is and the benefits it provides
  • Concurrency, parallelism, threads, and processes
  • The global interpreter lock and the challenges it poses to concurrency
  • How non-blocking sockets can achieve concurrency with only one thread
  • The basics of how event-loop-based concurrency works

Many applications, especially in today’s world of web applications, rely heavily on I/O (input/output) operations. These types of operations include downloading the contents of a web page from the internet, communicating over a network with a group of microservices, or running several queries together against a database such as MySQL or Postgres. A web request or communication with a microservice may take hundreds ...

Get Python Concurrency with asyncio now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.