Improving our example 3 – this is… not… good…
Pretend you haven’t read this section title and enjoy the fact that our previous example compiled and showed the correct result.
I think our coroutine implementation is so good now that we can look at some optimizations instead. There is one optimization in our executor in particular that I want to do immediately.
Before we get ahead of ourselves, let’s set everything up:
- Create a new folder called
c-coroutines-problem
and copy everything fromb-coroutines-references
over to it - You can change the name of the project so that it corresponds with the folder by changing the
name
attribute in thepackage
section inCargo.toml
, but it’s not something you need to do for the example to work
Tip
This example is located in this book’s GitHub repository in the ch
09
/c-coroutines-problem
folder.
With that, everything has been set up.
Back to the optimization. You...