What is the difference between processes, programs and threads?
In an OS context, a program is a file containing machine instructions. A process is an instance of a program in execution. A process is created whenever a program is loaded into memory for running on the CPU.Sometimes, we may want to have a process logically divided into multiple entities sharing the same address and data space, but having different logical paths or ‘threads of control’. In that case, we need a mechanism to create and manage these different logical entities within a process. If the system supports such a feature, these entities within a process are called threads.In a sense, threads are to a single process as multiple processes are to a machine; just as the machine sees a single process which is managed in software as different processes, the OS allocates resources to a single process which are then managed by the threads within the process.[See Ch. 12 of [MOS/Tanenbaum] for more info on threads].