ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Async I/O in Depth: State Machines, Event Loops and Non-Blocking I/O System Calls

rust

rust lang

rust programming

rust programming language

rust language

leetcode

#rust

rust tutorial

programming exercises

async io in rust

socket programming

tcp listener

web server in rust

http server in rust

implementing a web server in rust

http in rust

http server

web server

libc

epoll

kqueue

poll

libuv

rust epoll

non-blocking io

non blocking io

reactor pattern

async await

event loops

state machines

finite state machines

concurrency

wakers

Автор: Thomas 🏕

Загружено: 2022-06-11

Просмотров: 10776

Описание: In this presentation we revisit the HTTP Web Server by looking at other system call apis that allow us to perform non-blocking calls. We look at various event based / queue based apis such as epoll, kqueue, poll, iocp, io_uring, wepoll. To build for these apis I cover the implementation of a State Machine and its use in working with a client request over time. We learn about the Reactor Pattern, Event Loops, executing tasks, polling event handlers, boxed dynamic traits, sending and sharing with send/sync, using a read/write lock and working with static lifetimes along the way. By the end of our presentation we will have successfully built a fully concurrent state machine that works with non-blocking I/O apis, executing tasks within an event loop, and using the reactor pattern to schedule and switch between various states in the client request. While this solution doesn't explicitly implement async/.await we cover the importance of understanding and implementing it this way and how the Rust compiler will actually generate something very similar to it.

In building the state machine by hand, we now are ready to move into building our own Async Runtime and working with Futures. We have a good understanding of the event loop, the reactor pattern, executing and scheduling tasks concurrently, and handling non-blocking I/O with various non-blocking event/queue based underlying system apis. We will take advantage of this in the next video in this series by building our own async runtime.

↠ References:
Reactor Pattern: https://en.wikipedia.org/wiki/Reactor...
epoll: https://man7.org/linux/man-pages/man7...
epoll/kqueue/iocp: https://cfsamson.github.io/book-explo...
poll: https://man7.org/linux/man-pages/man2...
as_raw_fd: https://doc.rust-lang.org/std/os/unix...
Poller: https://docs.rs/polling/latest/pollin...
RwLock: https://doc.rust-lang.org/std/sync/st...
Arc: https://doc.rust-lang.org/std/sync/st...
Mutex: https://doc.rust-lang.org/std/sync/st...
Box: https://doc.rust-lang.org/std/boxed/s...
dyn Trait keyword: https://doc.rust-lang.org/std/keyword...
std::process: https://doc.rust-lang.org/std/process...
fs::File: https://doc.rust-lang.org/std/fs/stru...
BufWriter: https://doc.rust-lang.org/std/io/stru...
BufReader: https://doc.rust-lang.org/std/io/stru...
HTTP Protocol: https://developer.mozilla.org/en-US/d...
Radix Tree: https://en.wikipedia.org/wiki/Radix_tree
Interrupts: https://en.wikipedia.org/wiki/Interrupt
Virtual Memory: https://en.wikipedia.org/wiki/User_sp...
JoinHandle: https://doc.rust-lang.org/std/thread/...
thread::spawn: https://doc.rust-lang.org/std/thread/...
std::net::TcpListener: https://doc.rust-lang.org/std/net/str...
std::net::SocketAddr: https://doc.rust-lang.org/std/net/enu...
std::net::TcpStream: https://doc.rust-lang.org/std/net/str...
std::io::Stdin: https://doc.rust-lang.org/std/io/stru...
std::io::Stdout: https://doc.rust-lang.org/stable/std/...
socket: https://man7.org/linux/man-pages/man2...
setsocketopt: https://linux.die.net/man/2/setsockopt
bind: https://man7.org/linux/man-pages/man2...
listen: https://man7.org/linux/man-pages/man2...
connect: https://man7.org/linux/man-pages/man2...
write: https://man7.org/linux/man-pages/man2...
read: https://man7.org/linux/man-pages/man2...
libc crate: https://github.com/rust-lang/libc

↠ Dotfiles: https://github.com/nyxtom/dotfiles
↠ Twitter: @nyxtom   / nyxtom  
↠ Channel:    / nyxtom  

Cheers! 🍻

🦀 #rust #rustlang #rustprogramming #exercises #programming

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Async I/O in Depth: State Machines, Event Loops and Non-Blocking I/O System Calls

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]