HackerTube.dev

Modeling Data Concurrency w/ Asynchronous I/O in Zig - RedisConf 2020

Redis · 10.9K views · 2020-06-18 · 49:20

Open on YouTube ↗

If playback is restricted in your region, try opening the original video. Use Mark watched to add it to your marked videos.

Overview

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.

On Hacker News

HN recommends it as the clearest explanation of how Zig achieves colorless async/await.

Recommended by 3 HN people across 3 months · HN mentions 2020–2021

Topics

Search by tags

What people said

kbd · 2021-04 · Strong recommendation

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: [VIDEO]

Read the original HN comment ↗
jorangreef · 2021-02 · Recommendation

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: [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

Read the original HN comment ↗
bvrmn · 2020-05 · Recommendation

There is an interesting approach in Zig to explicitly kick call frames to achieve colorless asyncness. [VIDEO]

Read the original HN comment ↗

Sources

Video by Redis, played through YouTube.

Data and selection notes

HN summaries and labels may contain AI errors. HN dates refer to discussions, not video publication.

HN Library: HackerTube export (2026-10-31) and open-index/hacker-news. Upstream summaries and classifications may contain AI errors.

Views, duration and playback status refresh separately from the published catalog. When an update fails, existing data remains visible.

Selection checks
  • SaaS & AI candidates: Topic keywords do not match
  • Editor-approved picks: Editorial review is required

Rule matches identify candidates. They do not guarantee video quality or financial results.

About the library and its sources