Note While I use 12 cores, you should use the number of cores on your machine. If we increase this number too much, our OS will not be able to […]
Read MoreAn example using concurrency – Runtimes, Wakers, and the Reactor-Executor Pattern
Experimenting with our new runtime If you remember from Chapter 7, we implemented a join_all method to get our futures running concurrently. In libraries such as Tokio, you’ll find a […]
Read MoreImplementing a proper Executor – Runtimes, Wakers, and the Reactor-Executor Pattern-2
ExecutorCore holds all the state for our Executor: ExecutorCore derives the Default trait since there is no special initial state we need here, and it keeps the code short and […]
Read MoreChanging the Future definition – Runtimes, Wakers, and the Reactor-Executor Pattern
How does this Waker compare to the one in the standard library? The Waker we create here will take the same role as the Waker type from the standard library. […]
Read MoreImproving our runtime design by adding a Reactor and a Waker – Runtimes, Wakers, and the Reactor-Executor Pattern
In this step, we’ll make the following changes: Tip You’ll find this example in the ch08/b-reactor-executor folder. If you follow along by writing the examples from the book, I suggest […]
Read MoreChanging the current implementation – Runtimes, Wakers, and the Reactor-Executor Pattern-2
The next function is the block_on function. I’ll go through it step by step: If the future returns NotReady, we write out a message letting us know that at this […]
Read MoreDesign – Runtimes, Wakers, and the Reactor-Executor Pattern
Before we go any further, let’s visualize how our system is currently working if we consider it with two futures created by coroutine/wait and two calls to Http::get. The loop […]
Read MoreImproving our base example – Runtimes, Wakers, and the Reactor-Executor Pattern
We’ll create a version of the first example in Chapter 7 since it’s the simplest one to start with. Our only focus is showing how to schedule and drive the […]
Read MoreIntroduction to runtimes and why we need them – Runtimes, Wakers, and the Reactor-Executor Pattern
As you know by now, you need to bring your own runtime for driving and scheduling asynchronous tasks in Rust. Runtimes come in many flavors, from the popular Embassy embedded […]
Read MoreTechnical requirements – Runtimes, Wakers, and the Reactor-Executor Pattern
In the previous chapter, we created our own pausable tasks (coroutines) by writing them as state machines. We created a common API for these tasks by requiring them to implement […]
Read More