Note While I use 12 cores, you should use the number of cores on your machine. If we increase this…
Creating a Waker – Runtimes, Wakers, and the Reactor-Executor Pattern
So, we need to find a different way for our executor to sleep and get woken up that doesn’t rely directly on Poll. It turns out that this is quite […]
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 MoreCreating a proper runtime – Runtimes, Wakers, and the Reactor-Executor Pattern
So, if we visualize the degree of dependency between the different parts of our runtime, our current design could be described this way: Figure 8.5 – Tight coupling between reactor […]
Read MoreNOTE – Runtimes, Wakers, and the Reactor-Executor Pattern
If you run the example on Windows, you’ll see that you get two Schedule other tasks messages after each other. The reason for that is that Windows emits an extra […]
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 MoreChanging the current implementation – Runtimes, Wakers, and the Reactor-Executor Pattern-1
Now that we have an overview of our design and know what to do, we can go on and make the necessary changes to our program, so let’s go through […]
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 MoreReactors and executors – Runtimes, Wakers, and the Reactor-Executor Pattern
Dividing the runtime into two distinct parts makes a lot of sense when we take a look at how Rust models asynchronous tasks. If you read the documentation for Future […]
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 More