Modeling Data Concurrency w/ Asynchronous I/O in Zig - RedisConf 2020
Redis3 HN recommenders · recommended in 3 months, 2020-2021
11K views · 6 years ago · talk · dated
Zig creator Andrew Kelley's RedisConf 2020 talk on modeling data flow with asynchronous I/O in Zig. It explains how Zig's async/await avoids function coloring, and Loris Cro demonstrates OkRedis, a zero-allocation Redis client.
HN recommends it as the clearest explanation of how Zig achieves colorless async/await.
48:46Rust's Journey to Async/Await
InfoQ
90K views • 6 years ago
32:24RustLatam 2019 - Without Boats: Zero-Cost Async IO
Rust Programming Language
55K views • 7 years ago
1:00:23[#36] Zig Roadmap 2024 - Andrew Kelley
Zig SHOWTIME
66K views • 2 years ago
2:34:01Crust of Rust: async/await
Jon Gjengset
246K views • 5 years ago
54:14Zig: A programming language designed for robustness, optimality, and clarity – Andrew Kelley
Recurse Center
75K views • 8 years ago
59:48The Road to Zig 1.0 - Andrew Kelley
ChariotSolutions
168K views • 7 years ago
51:27Google I/O 2012 - Go Concurrency Patterns
Google for Developers
894K views • 14 years ago
46:40Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)
ChimiChanga
415K views • 2 years ago
43:20Zig Roadmap 2023 - Andrew Kelley
Zig SHOWTIME
77K views • 4 years ago
52:54Rust at speed — building a fast concurrent database
Jon Gjengset
225K views • 7 years ago
3:03:54The Why, What, and How of Pinning in Rust
Jon Gjengset
87K views • 7 years ago
1:10:05Are We There Yet - Rich Hickey
Zhang Jian
24K views • 7 years ago
58:08Parallelism, Concurrency, and Asynchrony in Perl 6 / Jonathan Worthington
yapcasia
6K views • 11 years ago
1:00:29Google I/O 2012 - Meet the Go Team
Google for Developers
108K views • 14 years ago
1:00:40Dmitry Vyukov — Go scheduler: Implementing language with lightweight concurrency
Hydra
47K views • 7 years ago
2:12:42Build Your Own Async
David Beazley
60K views • 7 years ago
2:32:39Clojure Concurrency - Rich Hickey
ClojureTV
73K views • 13 years ago
36:18"Data Driven UIs, Incrementally" by Yaron Minsky
Strange Loop Conference
20K views • 8 years ago
42:382021: Year of the Linux Gaming Desktop - Andrew Kelley
Zig SHOWTIME
15K views • 5 years ago
1:13:53Raymond Hettinger, Keynote on Concurrency, PyBay 2017
SF Python
161K views • 9 years ago
4 comments from Hacker News
I really can't agree with this premise after seeing how Zig implements color-less async/await: link I highly recommend watching Andrew Kelley's video (linked in that article) on this topic: ▶ this video
I recently wrote an IO abstraction over io_uring using Zig's async/await. Here's how you would do a write()/fsync()/read() with this ( link ): const offset: u64 = 0; const bytes_written = try io.write(fd, buffer_write[0..], offset); try io.fsync(fd); const bytes_read = try io.read(fd, buffer_read[0..], offset); Other sync functions can use this asynchronous IO completion code in a synchronous style (as this snippet shows) and still get all the zero-syscall and asynchronous performance of io_uring. What this is actually doing under the hood is filling SQEs into io_uring's submission queue ring buffer and then later reading completion events off io_uring's completion queue ring buffer, so it's fully asynchronous in the I/O sense but this hasn't spilled out and leaked over into the control flow. The control flow is as it should be, nice and simple and synchronous. Beyond this, Zig still allows you to explicitly indicate concurrency with the `async` keyword, for example if you wanted to run multiple async code paths concurrently. But the crucial part is that Zig's async/await does not force function coloring on you to do all of this: ▶ this video Pretty incredible on Zig's part to be able to pull this off. Huge kudos to Andrew Kelley. Also, thanks to Jens Axboe and io_uring, what you saw above was first-class single-threaded or thread-per-core, there's no threadpool doing that for you, it's pure ring buffer communication to the kernel and back, no context switches, no expensive coor
There is an interesting approach in Zig to explicitly kick call frames to achieve colorless asyncness. ▶ this video
> Code that's meant to be pinned (and may behave incorrectly if not pinned) looks no different from any other code. Same goes for async/await. The decision to keep you running on the same native thread is up to the scheduler. > Java isn't positioned as a high-level, high-abstraction language and that's not, IME, the user community it has. I beg to differ. It aims to be a good compromise between productivity, observability and performance. Every choice, from JIT to GC, is about improving performance for the common case while helping productivity, not improving performance by adding fine-grained control. There are a few cases where this is not possible. Primitives is one of them, and, indeed, 25 years later, we're "expanding" primitives rather than find some automatic way for optimal memory layout. > It's always been advertised as a safer alternative to C++ - rather like Rust. I think you're mistaken, and in any event, this is certainly not our position. Java is designed for a good blend of productivity, observability and performance, and unless the circumstances are unusual, it opts for improving common-case performance with high abstractions rather than worst-case performance with low abstractions like C++/Rust. Roughly speaking, the stance on performance is how do we get to 95% with the least amount of programmer effort. Anyway, regardless of what I said above, the constraints on the design of usermode threads other than philosophy are also very different for Java than for C