Chapter 2: Threads and Program Contexts

2.1 Introduction

Concurrent programs have some very different properties from the more common procedural programs with which traditional programmers are familiar. For example, if a procedural program is run repeatedly with the same input, one rightly expects the same result each time, which is nice because a program can be shown to be correct for at least the limited number of cases tested. It also means that any bugs will be reproducible and will occur each time the program is run. The same is not true of concurrent programs, where a program that is run repeatedly can legitimately produce a different answer each time.

This chapter explains what is happening while a program, either procedural or concurrent, ...

Get Creating Components now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.