Zig's I/O and Concurrency Story - King Protty - Software You Can Love 2022

  Рет қаралды 17,759

Zig SHOWTIME

Zig SHOWTIME

Күн бұрын

0:00 Talk
30:13 Q&A

Пікірлер: 33
@d0m96
@d0m96 Жыл бұрын
Awesome talk! Thanks for putting it together, learned a lot :)
@tenthlegionstudios1343
@tenthlegionstudios1343 10 ай бұрын
came to this talk before I knew what tiger beetle was - since then I have watched almost all the tiger beetle videos and looked into the code. TigerBeetle is legit - your consensus algorithm is one of the most straightforward beautiful things, the two LSM tree's built in house plus all IO optimizations plus all the memory safety are so cool. View Time Stamped replication is amazing. State replication machines and protocol aware recovery - so cool. Also, love this talk and am coming back for a second time to watch it again. Thanks!
@10e999
@10e999 Жыл бұрын
Hum I'm not at the level required to follow this talk properly. that said, I'm glad Zig conf tackle advance topics. It's motivating to slowly understanding more about system programming.
@sanador2826
@sanador2826 Жыл бұрын
Same boat but now I have some language to use for reading :D
@10e999
@10e999 7 ай бұрын
@@sanador2826 Great mantality !
@CallousCoder
@CallousCoder 9 ай бұрын
Oh nice another lecture by King! I love hearing him talk! He as a knack for doing complex material in a very airy funny way. I love it!
@hbobenicio
@hbobenicio Жыл бұрын
Awesome talk King!
@michaelravits2309
@michaelravits2309 Жыл бұрын
Thanks! Very clear explanation.
@RobertLJ11
@RobertLJ11 Жыл бұрын
Great talk . Thank you 😀
@marijnstollenga1601
@marijnstollenga1601 Жыл бұрын
Can't wait for this! Sounds like with this you would have amazing performance simply by embracing async in your pograms
@vladyslav007
@vladyslav007 Жыл бұрын
Yey, cool to see some zig talks again
@nickdhrones6425
@nickdhrones6425 Жыл бұрын
New to zig! Learned a lot.
@Pascal-uq8gw
@Pascal-uq8gw 9 ай бұрын
What an information bomb! 🎁 A lot of things are starting to make sense now. Keep it up.
@13madman37
@13madman37 Жыл бұрын
I always find it interesting to see that people stop at Overlapped IO when talking about non-blocking IO on Windows. APIs like Registered IO (now available for well over 10 years) and IoRing (okay, this is something new right now) are available too and are very similar to io_uring which everyone seems to talk about...
@kprotty6828
@kprotty6828 Жыл бұрын
AFAIK (correct me if i'm wrong here), windows RIO requires registered buffers which wouldn't fit zig's intrusive memory model + would hit the locked memory limit on linux for general purpose use. IoRing is getting there but currently only documents/supports reads and requires windows 11.
@13madman37
@13madman37 Жыл бұрын
@@kprotty6828 Thanks for the reply. I mainly wanted to make the general observation that Registered IO and IoRing were not mentioned in the talk as it seems to be the case everywhere. These APIs always seem to be overlooked. And yes, Registered IO works with physically locked buffers and I only worked with it in specific contexts where this wasn't an issue (never tried to build a library on top of it). While writes are now supported by IoRing, they are still not documented in the Win32 API (took this info from the windows-internals blog).
@origamibulldoser1618
@origamibulldoser1618 Жыл бұрын
Lots of context and knowledge. Very interesting :)
@beauteetmusculation8191
@beauteetmusculation8191 Жыл бұрын
Thanks for the video. I've worked a bit with the network API of the Zig standard library and it was somewhat confusing to me. Ended-up using a very simple poll(2) syscall and call it a day. I know it's not AT ALL efficient, but at least it's available everywhere and is pretty simple. I really hope there will be a way, someday, to make efficient network applications without having to dig into very obscure, non-portable APIs. For now, the Zig standard networking API seems at an early stage.
@TheOneWhoHasWallnuts
@TheOneWhoHasWallnuts Жыл бұрын
>Get rid of current event loop? Finally!!! To me it's currently the most unintuitive and opaque thing in zig to be forced into the event loop's pattern when making use of std. What I'd like to have is the ability to write my own (close to main) and hand STL a yield function (at compile time) which gives me back my thread immediately when called (via `suspend`). The response I'd expect from an STL-provided wait function kinda like I/O Completion Port does it. This wait function would give you incoming connections or files or cpu bound tasks even (as a tagged union) you can switch on. This can be in user space of course if possible. In practice this would mean that the user runs their own thread pool (e.g. 1 thread per logical core), each thread calling wait in a loop and handling the event when it becomes available. What I'm not sure about is how to best allow the user to integrate their own tasks. Ideally there'd be only 1 wake trigger.
@kprotty6828
@kprotty6828 Жыл бұрын
Zig (stdlib) doesn't enforce the event loop but provides it as an option for those who don't want to implement their own. Zig async also operates on coroutines (stackless state machines it builds) rather than OS threads or the traditional green thread approach. It sounds like you want a cross-platform reactor instead? By running their own thread pool, would that mean multiple threads polling the same reactor? This is what Go, Tokio, and Zig's stdlib current event loop already do: You have fine grained scheduling with `Loop.onNextTick(&node_with_suspended_frame_to_resume)` and IO completions are serviced via said frames (handling and dispatching ready tasks are done inside the loop). If this doesn't sound like what you want, were you instead describing the thread-per-core architecture in the video?
@TheOneWhoHasWallnuts
@TheOneWhoHasWallnuts Жыл бұрын
Sounds like I gotta mess with it again some time - Probably when 0.10.1 drops. The way I remember it, in order to roll your own, you'd have to implement the same interface the STL event loop uses, which wasn't just yield/wait but something opinionated I couldn't become friends with and also wouldn't let me just throw my own frames in.
@nathanfranck5822
@nathanfranck5822 Жыл бұрын
20:12 Jared Sumner just hates Windows confirmed
@baobaobiz
@baobaobiz 6 ай бұрын
"I own concurrency". Only 15 secs in, a sudden tsunami of respect thrusting my way.
@doge6363
@doge6363 Жыл бұрын
gr8 talk
@everestshadow
@everestshadow Жыл бұрын
I would like to see a runtime with dynamic amount of io reactors. a single poll based event loop can stop to scale completely when many fd given. On the other hand thread per io reactors can be waste of resource as you don't always need io throughput.
@Pismice
@Pismice Ай бұрын
Hey I’m new to concurrency and I’m trying to wrap my heads about all the concepts surrounding this topic. Do you have any good books or blogs or whatever so that I can understand it deeper ?
@martinmartin6300
@martinmartin6300 6 ай бұрын
I am not nearly as deep into zig as you guys but as someone who came from outside I have to say that asyncio seems to be a big mistake imho. Zig is supposed to be "simple" but even after that shirt period of evolvment time zig seems to be more and more cluttered with optional/secondary stuff.
@michaelravits2309
@michaelravits2309 Жыл бұрын
One question, why TigerBeetle didn't go straight with DPDK. Sacrificing cross platform, but kinda makes sense in your case, no?
@tigerbeetledb
@tigerbeetledb Жыл бұрын
Great question! We were aware of it, but our philosophy is to work on commodity hardware, targeting slow/small hardware as well, and being fast like that (e.g. thinking about disk/memory access patterns). With large enough disk blocks (64 KiB) and with io_uring, performance is almost also on par, from what we have read. TigerBeetle was designed just as io_uring was out, so we were also lucky that we had the benefit of being able to target it.
@MarkVolkmann
@MarkVolkmann 8 ай бұрын
If you were hoping to learn how to write some specific Zig code, you won’t see it in this talk. Zero lines of ZIP Code are displayed.
@Peter-bg1ku
@Peter-bg1ku 8 сағат бұрын
Yes, zero lines of "ZIP Code" displayed, you are correct ..
@abanoubha
@abanoubha Жыл бұрын
great talk 🤍
어른의 힘으로만 할 수 있는 버블티 마시는법
00:15
진영민yeongmin
Рет қаралды 11 МЛН
1❤️
00:20
すしらーめん《りく》
Рет қаралды 33 МЛН
КАРМАНЧИК 2 СЕЗОН 5 СЕРИЯ
27:21
Inter Production
Рет қаралды 594 М.
How Zig is used at Uber - Motiejus Jakštys
36:56
Zig SHOWTIME
Рет қаралды 23 М.
How Voronoi Diagrams Can Speed Up Your Game - Advanced Gamedev
16:23
Is it concurrent or parallel?
3:48
Jacob Sorber
Рет қаралды 17 М.
TigerBeetle - How We Use Zig by King Protty
22:42
TigerBeetle
Рет қаралды 2,5 М.
TigerBeetle - A Million Financial Transactions per Second in Zig
1:10:55
AMD больше не конкурент для Intel
0:57
ITMania - Сборка ПК
Рет қаралды 523 М.
ПРОБЛЕМА МЕХАНИЧЕСКИХ КЛАВИАТУР!🤬
0:59
Корнеич
Рет қаралды 3,5 МЛН
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 50 МЛН
Nokia 3310 versus Red Hot Ball
0:37
PressTube
Рет қаралды 3,8 МЛН