当前位置: 动力学知识库 > 问答 > 编程问答 >

process - Why I/O-bound processes are faster?

问题描述:

Typically the CPU runs for a while without stopping, then a system call is made to read from a file or write to a file. When the system call completes, the CPU computes again until it needs more data or has to write more data, and so on.

Some processes spend most of their time computing, while others spend most of their time waiting for I/O. The former are called compute-bound; the latter are called I/O-bound. Compute-bound processes typically have long CPU bursts and thus infrequent I/O waits, whereas I/O-bound processes have short CPU bursts and thus frequent I/O waits.

As CPU gets faster, processes tend to

get more I/O-bound.

Why and how?


Edited:

It's not a homework question. I was studying the book (Modern Operating Systems by Tanenbaum) and found this matter there. I didn't get the concept that's why I am asking here. Don't tag this question as a homework please.

网友答案:

With a faster CPU, the amount of time spent using the CPU will decrease (given the same code), but the amount of time spent doing I/O will stay the same (given the same I/O performance), so the percentage of time spent on I/O will increase, and I/O will become the bottleneck.

That does not mean that "I/O bound processes are faster".

网友答案:

As CPU gets faster, processes tend to get more I/O-bound.

What it's trying to say is:

As CPU gets faster, processes tend to not increase in speed in proportion to CPU speed because they get more I/O-bound.

Which means that I/O bound processes are slower than non-I/O bound processes, not faster.

Why is this the case? Well, when only CPU speed increases all the rest of your system haven't increased in speed. Your hard disk is still the same speed, your network card is still the same speed, even your RAM is still the same speed*. So as the CPU increases in speed, the limiting factor to your program becomes less and less the CPU speed but more about how slow your I/O is. In other words, programs naturally shift to being more and more I/O bound. In other words: ..as CPU gets faster, processes tend to get more I/O-bound.

*note: Historically everything else also improved in speed along with the CPU, just not as much. For example CPUs went from 4MHz to 2GHz, a 500x speed increase whereas hard disk speed went from around 1MB/s to 70MB/s, a lame 70x increase.

分享给朋友:
您可能感兴趣的文章:
随机阅读: