Understanding concurrency and multithreading
The simplest form of running a program involves its instructions being executed one by one by the central processing unit (CPU). As you already know from previous chapters, a program consists of several sections, one of them containing the instructions of the program. Each instruction is loaded into a CPU register for the CPU to decode and execute it. It doesn’t matter what programming paradigm you use to produce an application as the result is always the same – the executable file contains machine code.
We mentioned that programming languages such as Java and C# use support environments. However, if you cut down the support environment in the middle (usually, the virtual machine), the final instructions being executed should have a form and format familiar to that particular CPU. It’s obvious to programmers that the order of statements run by the CPU is not mixed in any circumstance. For example, we are sure and...