←back to thread

320 points willm | 4 comments | | HN request time: 0.001s | source
1. OutOfHere ◴[] No.45106532[source]
With the newest Python, I can use no-gil, so my threads automatically use multiple cores. With asyncio, even under no-gil, unless I use a base layer that offers parallelism, I am stuck to a single core by default, which doesn't make any sense in a multicore world. In contrast, with Rust's async, there is no such limitation.

The traditional argument against the above assertion has been that asyncio is good for I/O work, not for CPU work, but this constraint is not realistic because CPU usage is guaranteed to creep in.

In summary, I can use threading/process/interpreter pools and concurrent futures, considering I need them anyway, without really needing to introduce yet another unnecessary concurrency paradigm (of asyncio).

replies(2): >>45106600 #>>45106699 #
2. rcarmo ◴[] No.45106600[source]
You should look into the various Pool classes. Back when asyncio came about, I did a lot of experimenting with various multi-core approaches: https://github.com/rcarmo/newsfeed-corpus
replies(1): >>45108152 #
3. ◴[] No.45106699[source]
4. ◴[] No.45108152[source]