Last but not least, whatever the period we are speaking about, why can we substract the probability of one of its states (when the CPU is idle) from the overall working time (that is $1$), thereby claiming that we are able to weigh up chances of CPU idleness vs CPU action ( $25\%$ vs $75\%$ in our example). But obviously this logic is not applicable to the whole CPU working time as it is nonsense to say that there is a $25\%$ probability of CPU idleness for the whole time. What is the time period they mean? When we toss a coin twice, the probability of getting two heads is exactly $0.5×0.5$ because it is one of four possible outputs. However, it puzzles me, why do the authors propose just multiply $0.5×0.5$ in this case to get the probability of CPU idleness. Supposing the CPU decided on the first process for running and the latter has spent the first period heavily working off $0.1$ of its overall time, we will have the probability for the next period, which is $0.5×0.565=0.2825$, and so on. Keeping this model in mind and utilizing the example with the two processes, we are able to calculate the probability of CPU idleness for each of this periods of time. For the sake of simplification, we could say that there are two states a process may have within this period: it is either ready to work or waiting for I/O. If the CPU schedules process execution within a small discrete time period, in fact, even for one single process that has the ratio of working to waiting as $0.5$ vs $0.5$ the number of possible ratios of working vs waiting parts within this period is infinity. However, I fail to get my mind around what is the way this conclusion may be come to. The autors' thought is that, from a probabilistic viewpoint, the CPU then will be in action for $75\%$ and sitting idle for $25\%$ of the working time. Let's suppose we have two processes each of which should wait for I/O for $0.5$ its overall time. The CPU utilization is then given by the formula That all $n$ processes are waiting for I/O (in which case the CPU willīe idle) is $p^n$. With $n$ processes in memory at once, the probability Suppose that a process spends a fraction $p$ of its time waiting for In the Modern Operating System by Andrew Tanenbaum, Herbert Bos the authors provide their explanation of the concept of CPU utilization in the following way:Ī better model is to look at CPU usage from a probabilistic viewpoint.
0 Comments
Leave a Reply. |