3 ms·
Async/await tend to be IO bound, in zigs case hiw can i know what to use and when? Say i do a db call, thats clearly IO, and later do heavy CPU thing, now how d
by phplovesong 1y ago
Async/await tend to be IO bound, in zigs case hiw can i know what to use and when? Say i do a db call, thats clearly IO, and later do heavy CPU thing, now how do i know that the CPU thing does not block inside my async io thing?
I guess its pure luck if the io implementation can handle both, but who knows?
- jufter 1y ago> how do i know that the CPU thing does not block inside my async io thing? I think it's common sense to not interweave IO with long-running CPU, hence sans IO. If you want to go that route, we already have solutions: goroutines and beam processes.
- phplovesong 1y agoThis was my point. With Go it does not matter, i can do IO or CPU both with Gos concurrency (CSP), but with async/await i usully cannot, i assume this is not something Zig is planning on, as it seems to be all about IO.