←back to thread

Async/Await is finally back in Zig

(charlesfonseca.substack.com)
39 points barddoo | 2 comments | | HN request time: 0.404s | source
1. pyrolistical ◴[] No.45782964[source]
> Despite the completion order varying, each task correctly writes to its designated position in the results array, showing proper concurrent data handling.

Huh? It’s not like the entire array was passed into each task. Each task just received a pointer to an usize to write to.

Where is concurrent data writing in the example?

replies(1): >>45783049 #
2. barddoo ◴[] No.45783049[source]
The requests were made concurrently. I don't understand your question. Passing in an array or a pointer does not matter.