2

I have been planning on writing some code that checks the free space on numerous disks attached to a server, which are mounted using iSCSI.

It's been warned that "polling for free space on a dead mount causes a very long timeout".

My question is basically this: Is this true when using the DiskInfo class, and is there a better alternative to determine the free space available on a disk mounted this way, at least "better" in that it doesn't hang for a long time and responds in a predictable manner?

user1270384
  • 711
  • 7
  • 24
  • 53
user132311
  • 21
  • 1
  • 1
    It is an Internet protocol, of course it will cause delays. Checking up front never makes any sense. Another client will gobble up a gigabyte between the time you check and the time you use. Don't waste the time to check "will it work". Deal with failure after you tried to make it work. – Hans Passant Sep 27 '12 at 22:35

1 Answers1

0

Probably not as the delays are caused by Windows' IO subsystem. But you're free to use the DiskInfo class in a second thread - so your UI won't be blocked.

Simon
  • 1,814
  • 20
  • 37