<Li> In time - sharing systems, the running task is required to relinquish the CPU, either voluntarily or by an external event such as a hardware interrupt . Time sharing systems are designed to allow several programs to execute apparently simultaneously . </Li> <Li> In real - time systems, some waiting tasks are guaranteed to be given the CPU when an external event occurs . Real time systems are designed to control mechanical devices such as industrial robots, which require timely processing . </Li> <P> The term "multitasking" has become an international term, as the same word is used in many other languages such as German, Italian, Dutch, Danish and Norwegian . </P> <P> In the early days of computing, CPU time was expensive, and peripherals were very slow . When the computer ran a program that needed access to a peripheral, the central processing unit (CPU) would have to stop executing program instructions while the peripheral processed the data . This was usually very inefficient . </P>

Define the term context switch with a appropriate example