Operating System Fundamentals 31 How does the process get out of the blocked state Each IO device has its own mechanism that it uses to interact with the operating system. We will consider just the keyboard example here. During boot up, the operating system has probably attached a service routine to the keyboard interrupt. Each time
that the user presses a key, it generates an interrupt which causes the operating system routine to generate a key event and the scheduler routine will be called. The scheduler will then look through all of the blocked processes waiting for key events and the state will be changed from blocked to ready. Whether this keyboard interrupt causes the currently running process to be moved from Running to Ready depends on the operating system itself. If you were to examine the states of processes on most computers, you will probably find that just about every process on the system is blocked most of the time. Having a lot of blocked processes is a good thing. This means that the CPU is not actually being used for any useful work. Normally when a CPU
does works it consumes power, while if it is not doing work it can be put into a low power state. Tricks such as these are used in mobile devices such as phones in order to extend the life of the battery. A process that is actively using the CPU will consume more power, which is why batteries do not last as long when you are watching videos on your mobile phone than when you are simply on standby waiting for calls.
Share with your friends: