Re:Python Asyncio: The Complete Guide
by dekhn on Thursday November 10, 2022 @01:38PM
(#33551072)
any concurrency system that is properly designed supports both types of tasks.
[ Parent
| on HN ]
I only know C#:
https://learn.microsoft.com/en-us/dotnet/csharp/async#recogn...
There you also have to act differently based the task
The docs on that page explicitly say you just have to provide a different parameter (basically, to force it to use a thread-like instead of select-like approach).
The docs on that page also point you to a different task library which does what I'd expect:
"If the work is appropriate for concurrency and parallelism, also consider using the Task Parallel Library."
I checked those docs and that is a framework that makes sense.
Not sure how that's different than Python asyncio's "run blocking stuff with `run_in_executor`, the result (future) of which integrates into the async event loop?
it's threaded with the option to use 1:M, N:N or N:M. It's a mental model that includes both asyncio and threads, while async will always only be for IO-blocking calls that can be multiplexed.