4 ms·
I only know C#: https://learn.microsoft.com/en-us/dotnet/csharp/async#recognize-cpu-bound-and-io-bound-work https://learn.microsoft.com/en-us/dotnet/csharp/asyn
by number6 4y ago
I only know C#:
https://learn.microsoft.com/en-us/dotnet/csharp/async#recognize-cpu-bound-and-io-bound-work https://learn.microsoft.com/en-us/dotnet/csharp/async#recogn...
There you also have to act differently based the task
- dekhn 4y agoThe 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.
- phs2501 4y agoNot 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?
- dekhn 4y agoit'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.