DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Taming disk accesses  (Read 15,529 times)

highflier

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1
Taming disk accesses
« on: December 31, 2006, 11:09 AM »
Hi all,

ProcessTamer does a good job in handling one of the bottlenecks of current computers, which is access to the CPU. It does so by changing the priorities of the processes. This works because Windows incorporates a priority-based queue for CPU access.

There's another important bottleneck in present-day computers: access to the disk(s). Windows doesn't include a priority-based queue for disk access. It just has a first come - first served queue. This can allow a low-priority process to virtually hang a computer.

Imagine the following situation: a certain process needs to make many, very frequent disk accesses. An example could be the disk scanning component of an anti-virus package, which has to access all the files in the disk to do its job. You set this process to low priority, in an attempt to make it run in the background, without disturbing your normal use of the computer. However, whenever the higher-priority processes leave a bit of free CPU time, this low-priority process is allowed to run. Even if it runs for a short time, it immediately fills the disk queue with a lot of access requests. Now, one of your higher-priority process runs again, and needs to make a single disk access. Since the disk queue is full of requests from the low-priority process, and since the disk is a relatively slow component, your high-priority process will have to wait until all the requests from the low-priority one are served. While the high-priority process waits to get its disk access served, the low-priority process gets to run a tiny bit of time again, and places a further lot of requests in the disk queue... The net effect is that the high-priority process is almost completely blocked by the low-priority one.

Situations like this are not infrequent. I think that some present-day disk scanners from anti-virus packages are already designed so as to prevent this from happening (e.g. by self-limiting the number of consecutive disk access requests that they make, and waiting until all of them are served before making new ones). But most other programs are not designed in that way. And a program that runs astray due to some bug can also start placing an inordinate number of requests in the disk queue. I've run into situations like this from time to time, and in some cases the only way to solve the problem was to press the reset button and then reboot, because even the task manager would take an inordinate amount of time to start, and therefore I was unable to kill the offending process.

This kind of problem can't be solved by changing process priorities: As I explained, even a low-priority process can effectively block high-priority ones. I think that the only way to handle it is to temporarily suspend the offending process, based on the number of disk requests that it makes. The best rules for doing this will probably have to be learned by experimenting. Certainly, it will be desirable to allow the user to explicitly exclude some processes from this kind of taming.

I don't know how hard it is to implement a strategy of this kind, because it means adding a taming philosophy that is very different from the one currently used by ProcessTamer. But it would certainly be a very useful addition.

On a side note, the fact that Windows still doesn't include a prioritized queue for disk access says a lot about Microsoft's own priorities in software development.

And on another side note, thanks a lot to Mouser for making ProcessTamer, and other useful programs, available to all of us.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Taming disk accesses
« Reply #1 on: January 01, 2007, 02:39 PM »
Welcome highflier,

There have been a few similar requests to this, regarding memory usage, and/or taming to reduce absolute cpu usage not just priority changing.. I am going to give some thought to this..

-mouser

CodeTRUCKER

  • Bush Flying... where I'd rather be.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,086
    • Participated in NANY Challenge Once
    • Military Service Badge - US Navy
Re: Taming disk accesses
« Reply #2 on: January 01, 2007, 02:45 PM »
I'll throw my hat in the ring.
DISCLAIMER - I have made and make many threads for questions and even project posts across the Internet. Unfortunately, many are in limbo because I cannot remember where they are at. If anyone knows of an open thread or an unanswered inquiry, please PM me. Thank you.
   
Notice: Unless stated otherwise, I receive no compensation for anything I post here.
« Last Edit: September 26, 2010, 07:11 AM by CodeTRUCKER »

yksyks

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 476
Re: Taming disk accesses
« Reply #3 on: January 08, 2007, 10:04 AM »
Another vote for taming the disk access. It would be really helpful for applications dealing with video files, for example. Usually I don't care how long it takes to finish, but I'd like to be able work in the meantime effectively. And despite the application itself consumes, say, 8 % of CPU; the PC is quite stuck due to the heavy disk access.

coen99

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 3
Re: Taming disk accesses
« Reply #4 on: January 16, 2007, 06:57 PM »

You also got my vote !  :Thmbsup:

Great feature.

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • Coding Snacks
Re: Taming disk accesses
« Reply #5 on: August 08, 2007, 10:37 PM »
Another vote. :up:
That would be extremely convenient.
"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,985
    • Gathering Badge
Re: Taming disk accesses
« Reply #6 on: August 08, 2007, 10:41 PM »
I'd like to add my vote, too  :Thmbsup:. Thanks for bumping this thread, Armando, if you hadn't I never would have noticed it!
"Some people have a way with words, other people,... oh... have not way" - Steve Martin

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • Coding Snacks
Re: Taming disk accesses
« Reply #7 on: August 08, 2007, 10:46 PM »
Actually, Darwin, it was yksyks who brought it to my attention -- from the Process tamer... Express your feature requests... thread.

So, thanks to yksyks too!  ;)
"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,985
    • Gathering Badge
Re: Taming disk accesses
« Reply #8 on: August 08, 2007, 11:09 PM »
Oops!  :-[ Thanks yksysks!
"Some people have a way with words, other people,... oh... have not way" - Steve Martin

stinky1

  • Participant
  • Joined in 2008
  • *
  • Posts: 4
Re: Taming disk accesses
« Reply #9 on: February 06, 2008, 06:33 PM »
This would be great, but I wonder if it is realistically achievable.

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • Coding Snacks
Re: Taming disk accesses
« Reply #10 on: February 06, 2008, 06:53 PM »
Actually, somebody explained somewhere that it was not possible....  :(

(BTW : welcome to DC, stinky1!)
"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould

stinky1

  • Participant
  • Joined in 2008
  • *
  • Posts: 4
Re: Taming disk accesses
« Reply #11 on: February 07, 2008, 03:09 PM »
Thanks Armando.  I think Vista is supposed to have this ability?

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Taming disk accesses
« Reply #12 on: February 07, 2008, 03:20 PM »
Vista added I/O priorities, yes... dunno how well it works, but at least the facility is there.
- carpe noctem

Original address: https://www.donationcoder.com/forum/index.php?topic=6803.0