Part 2:Event Queues and Green Threads
In this part, we’ll present two examples. The first example demonstrates the creation of an event queue using epoll. We will design the API to closely resemble the one used by mio, allowing us to grasp the fundamentals of both mio and epoll. The second example illustrates the use of fibers/green threads, similar to the approach employed by Go. This method is one of the popular alternatives to Rust’s asynchronous programming using futures and async/await. Rust also utilized green threads before reaching version 1.0, making it a part of Rust’s asynchronous history. Throughout the exploration, we will delve into fundamental programming concepts such as ISAs, ABIs, calling conventions, stacks, and touch on assembly programming. This section comprises the following chapters:
- Chapter 4, Create Your Own Event Queue
- Chapter 5, Creating Our Own Fibers