开发者

Theories on how to make a quiet program? One that runs slowly in the background

Any program I mak开发者_如何转开发e has two stages it can be in: using as much of the processor as possible, and blocking, waiting for input. Now I have programs on my computer, things like Backblaze, which run gradually in the background (though with some occasional spikes when encrypting files). What are some good ways to make a program run slowly and unnoticeable? The only thing I could think of would be to fill it with sleep statements, which seems awfully inefficient. I'm not asking about a specific language here, just some general theory.

Any thoughts?


In general, program is noticeable if it uses either CPU or disk. For CPU, you can decrease the process priority: nice(10) on Linux, SetPriorityClass(..._IDLE) on Windows.

For HDD, there is "ionice" on Linux, and I am not sure if anything exists on Windows. You might just have to rate-limit your disk reads and writes, if you have many of them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜