Multi-programming (or multi-tasking) enables more than a single process to apparently
execute simultaneously. How is this achieved on a uniprocoessor?
Answer:
-Multiprogramming is achieved on a uniprocessor by the concept of “threading”. Every process' total running time is divided up into threads, which are a subset of the process' instructions that can be completed in a certain amount of time, called a timeslice. When a thread's timeslice is finished, CPU time has to switch to a different thread. On a large scale, these timeslices are nanoseconds long, so it appears to the user that the processor is processing processes concurrently. The ultimate goal is to keep the system responsive while really maximising the processor's ability to process.
-The above scenario is known as Pre-Emptive multitasking. An alternative scheme is Cooperative
Multitasking, where each process occasionally yields the CPU to another process so that it may run.