Skip to Main Content
Python Concurrency with asyncio
book

Python Concurrency with asyncio

by Matthew Fowler
February 2022
Intermediate to advanced content levelIntermediate to advanced
376 pages
10h 54m
English
Manning Publications
Content preview from Python Concurrency with asyncio

7 Handling blockingwork with threads

This chapter covers

  • Reviewing the multithreading library
  • Creating thread pools to handle blocking I/O
  • Using async and await to manage threads
  • Handling blocking I/O libraries with thread pools
  • Handling shared data and locking with threads
  • Handling CPU-bound work in threads

When developing a new I/O-bound application from scratch, asyncio may be a natural technology choice. From the beginning, you’ll be able to use non-blocking libraries that work with asyncio, such as asyncpg and aiohttp, as you begin development. However, greenfields (a project lacking constraints imposed by prior work) development is a luxury that many software developers don’t have. A large portion of our work may be managing existing ...

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.
Start your free trial

You might also like

Building Python Microservices with FastAPI

Building Python Microservices with FastAPI

Sherwin John C. Tragura
Python for DevOps

Python for DevOps

Noah Gift, Kennedy Behrman, Alfredo Deza, Grig Gheorghiu

Publisher Resources

ISBN: 9781617298660Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link