concept serial world in category parallel computing

This is an excerpt from Manning's book Parallel and High Performance Computing.
Parallel computing is the execution of many operations at a single instance in time. Fully exploiting parallel computing does not happen automatically. It requires some effort from the programmer. First, you must identify and expose the potential for parallelism in an application. Potential parallelism, or concurrency, means that you certify that it is safe to conduct the operations in any order as the resources become available on the system. For parallel computing there is an additional requirement; these operations must occur at the same time. For this to happen, you must also properly leverage the resources to execute them simultaneously. Parallel computing introduces new concerns that are not present in a serial world. A change in thought process is needed to adapt to the additional complexities of parallel execution, but with practice, it begins to be second nature. This book begins your journey on how to access the power of parallel.
As you can see, all of the threads report that they are thread number 3. This is due to nthreads and thread_id being shared variables. The value that they get assigned is the one written by the last thread to write to the variables. This is a typical race condition, as illustrated in figure 7.3. It is a common issue in threading programs of any type.