diff --git a/book/1_why_futures.html b/book/0_background_information.html similarity index 76% rename from book/1_why_futures.html rename to book/0_background_information.html index 3864a0f..45b4ae7 100644 --- a/book/1_why_futures.html +++ b/book/0_background_information.html @@ -3,7 +3,7 @@ - Why Futures - Futures Explained in 200 Lines of Rust + Background information - Futures Explained in 200 Lines of Rust @@ -78,7 +78,7 @@ @@ -149,14 +149,22 @@
-

Why Futures

+

Some Background Information

Before we go into the details about Futures in Rust, let's take a quick look at the alternatives for handling concurrent programming in general and some pros and cons for each of them.

+

While we do that we'll get some information on concurrency which will make it +easier for us when we dive in to Futures specifically.

+
+

For fun, I've added a small snipped of runnable code with most of the examples. +If you're like me, things get way more interesting then and maybe you'll se some +things you haven't seen before along the way.

+

Threads provided by the operating system

-

Now one way of accomplishing this is letting the OS take care of everything for +

Now, one way of accomplishing this is letting the OS take care of everything for us. We do this by simply spawning a new OS thread for each task we want to accomplish and write code like we normally would.

+

The runtime we use to handle concurrency for us is the operating system itself.

Advantages: