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 Reactor – Runtimes, Wakers, and the Reactor-Executor Pattern-3
The first thing we do is give HttpGetFuture an identity. It’s the source of events we want to track with our Reactor, so we want it to have the same […]
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 MoreImplementing a proper Executor – Runtimes, Wakers, and the Reactor-Executor Pattern-1
In this step, we’ll create an executor that will: Note It’s worth mentioning that our executor won’t be fully multithreaded in the sense that tasks/futures can’t be sent from one […]
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 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 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 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 More