# Threads, async/await, Promises, Futures

- Show: [Oxide and Friends](https://hardwarepodcasts.com/podcast/oxide-and-friends)
- Published: 2022-09-13
- Length: 1h 15m
- Episode: 27
- Page: https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures
- Listen: https://share.transistor.fm/s/9dafc631

## Summary

Adam Leventhal, Brian Cantrill, and guests from Oxide Computer Company discuss the difficulty of explaining async/await, prompted by Adam's attempt to teach his son C++. They contrast synchronous threading with asynchronous models, tracing the history from Solaris lightweight processes to modern Rust, Go, and Zig implementations. The group highlights significant debugging challenges in async systems, including hidden queues, non-linear response times, and the loss of stack trace context, citing painful experiences with Node.js, Erlang/RabbitMQ, and Python's Trollius library. They explore various language-specific approaches, such as Zig's explicit stack frames and Go's signal-based blocking handling, to determine when async is appropriate and how to make it debuggable.

## Chapters

- [0:00](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=0) Introduction: Language debates and Adam's son learning C++
- [4:26](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=266) Explaining async/await: The Feynman technique and documentation
- [11:18](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=678) Historical context: Solaris 2-level scheduling and LWPs
- [17:24](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=1044) Debugging challenges: Stack traces, task IDs, and comprehensibility
- [22:51](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=1371) System call blocking: Go runtime signals and Rust pathologies
- [31:13](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=1873) Production failures: Erlang, RabbitMQ, and the 'rabbit hole'
- [37:36](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=2256) Alternative models: Zig stack frames and Python's Trollius hack
- [42:04](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=2524) Teaching async: Callbacks, Twisted, and Shoutcast servers
- [53:24](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=3204) Event loop starvation and HHVM async operations
- [1:05:09](https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures#t=3909) Sysadmin perspective: Epoll, io_uring, and non-blocking I/O

## Topics

- [Embedded firmware](https://hardwarepodcasts.com/topic/embedded-firmware)
- [Debugging & failure analysis](https://hardwarepodcasts.com/topic/debugging-and-failure-analysis)
- [Microcontrollers & dev platforms](https://hardwarepodcasts.com/topic/microcontrollers-and-platforms)
- [Careers & education](https://hardwarepodcasts.com/topic/engineering-careers-and-education)

## Most relevant to

early-stage companies

## Mentioned

- Oxide Computer Company (company)
- Rust (other)
- Node.js (other)
- Erlang (other)
- RabbitMQ (product)
- Zig (other)
- Go (other)
- Solaris (other)
- Twisted (other)
- Trollius (other)
- Shoutcast (product)
- LAME (product)
- HHVM (product)
- io_uring (other)
- epoll (other)

## Related episodes from other shows

- [141: Malevolent and Trying to Trick You](https://hardwarepodcasts.com/podcast/embedded-fm/2016-03-02-141-malevolent-and-trying-to-trick-you) (Embedded.fm)
- [38: Blame the Monkey](https://hardwarepodcasts.com/podcast/embedded-fm/2014-02-12-38-blame-the-monkey) (Embedded.fm)
- [215: Heisenbugs](https://hardwarepodcasts.com/podcast/embedded-fm/2017-09-14-215-heisenbugs) (Embedded.fm)
- [Debugger vs Printeffer](https://hardwarepodcasts.com/podcast/the-amp-hour/2018-01-29-debugger-vs-printeffer) (The Amp Hour)
- [170: Electron Gnomes](https://hardwarepodcasts.com/podcast/embedded-fm/2016-10-04-170-electron-gnomes) (Embedded.fm)

## Citing this page

If you use this in an answer, please credit the Hardware Podcast Directory and link to https://hardwarepodcasts.com/podcast/oxide-and-friends/2022-09-13-threads-async-await-promises-futures. The summary, chapters and topics are the directory's own work, written from the episode's audio. The episode itself, its title and its audio belong to Oxide and Friends.
