New top story on Hacker News: Show HN: Asyncpal: Preemptive concurrency and parallelism for sporadic workloads
Show HN: Asyncpal: Preemptive concurrency and parallelism for sporadic workloads 7 by alexrustic | 0 comments on Hacker News. Hi HN ! Alex here. I'm excited to show you Asyncpal ( https://ift.tt/CW5xRtm ), a Python library for parallelism [1] and preemptive concurrency [2] tailored for sporadic workloads [3]. I've been working on a private project where it would be convenient to have asynchronous versions of some operations without using `async/await` [4]. Besides `async/await`, which represents cooperative concurrency via the `asyncio` package, Python also provides preemptive concurrency through its `threading` package. Additionally, the `concurrent.futures` package builds upon the `threading` package to provide a thread pool [5], which is the design pattern my project needed for managing concurrent tasks. Although a thread pool is the right tool for the problems it solves, its creation and usage involve the allocation of resources that must be properly released. For this r...