Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Three programs are started at the same moment. Program 1 needs ms of processor time, program 2 needs ms and program 3 needs ms. The operating system gives turns of ms in the order 1, 2, 3, 1, 2, 3, and so on. A program that has finished gets no more turns.
At what time does each program finish?
The operating system manages files, handles interrupts, provides an interface, manages peripherals and drivers, manages memory, manages multitasking, provides a platform for running applications, provides system security and manages user accounts. In multitasking, programs take short turns on the processor, so they seem to run at the same time.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. List the turns of ms and keep a running time.
Step 1. First round. Program 1 runs to ms, program 2 to ms, program 3 to ms. Program 3 has had its ms, so it finishes at ms.
Step 2. Second round. Program 1 runs to ms. It has now had ms, so it finishes at ms. Program 2 runs to ms, and has had ms.
Step 3. The last turn. Only program 2 is left. It runs to ms and finishes at ms.
Answer: program 1 at ms, program 2 at ms, program 3 at ms.
Check. The programs need ms in all, and the last one finishes at ms. The processor was never idle.
Log in to join the discussion.
Loading…