Chapter 13. Going Parallel

Imagine that you have written a program that controls some physical process, like rapidly blinking an LED at a fixed frequency. You want to control the parameters of this process through a web service interface, perhaps to adjust the blinking period. This simple scenario raises a far-reaching question. Consider our previous server examples that repeatedly wait for new incoming HTTP requests. Whenever a request arrives, the server wakes up, does something, sends back a response, and then waits again. While it waits, the server blocks all other activity until the next request comes in, which may easily take hours. This means that even if you wrote some code to blink the LED, it’s not going to blink if the server is ...

Get Getting Started with the Internet of Things now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.