A process is essentially a program that is executing on an operating system. This process is made up of more than one thread of execution. A thread of execution is a set of commands issued by a process. The ability to execute more than one thread at a time is known as multi-threading. In this chapter, we are going to look at multi-threading and concurrency.
Multiple threads are allotted a set amount of time to execute, and each thread is executed on a rotational basis by a thread scheduler. The thread scheduler schedules the threads using a technique called time slicing and then passes each thread to the CPU to be executed at the scheduled time.
Concurrency is the ability to run more than one thread at exactly the same time. This can be accomplished on computers with more than one processor core. The more processor cores a computer has, the more threads of execution can be executed concurrently...