| ▲ | fulafel 2 days ago | |||||||
You involve the kernel also when you are doing async io. In this context the interesting thing to measure would be doing IO in your green threads vs OS threads. A stronger theoretical performance argument for async io is that you can do batching, ala io_uring, and do fewer protection domain crossings per IO that way. | ||||||||
| ▲ | a day ago | parent | next [-] | |||||||
| [deleted] | ||||||||
| ▲ | audunw a day ago | parent | prev [-] | |||||||
Well yeah of course, using APIs io_uring and grand central dispatch is basically the whole point of all this async stuff in a systems programming language. It’s absurd it hasn’t been mentioned more here. OS Threads are for compute parallelism, async with stackless coroutines (ideally) or green threads is for IO parallelism. It’s pretty straight forward. And IMO, Zig has show how to do async IO right (the foundational stuff. Other languages could add better syntax for ergonomics. | ||||||||
| ||||||||