I am in the position to examine my code to ensure it does not hog the IO(HDD) and prevent other services/programs from doing their job but I am having trouble finding information on what and where I should worry about things so I have a few questions. For what its worth I am making a C# application.
small files = <2k
Situaton 1:
My Program reads LOTS of small files one by one doing a negligible amount of calculation inbetween this loop. Does windows process these and other IO requests in FIFO order which thereotically prevents any longterm IO blockage on tiny file reads?
Situaton 2:
Same as situation 1 but with writing small files instead.
large files = ??100mb??
Situation 3:
Reading lots of large files in a loop, will other processes be able to swoop in inbetween the loops and access the IO or even during the read itself? If able to swoop in during my read, is it because my large read has been split into multiple IO requests by windows or something else?
Situation 4:
Same as Situation 3 but now with writing large files.
For my application in question only situation 2 applies, but this has got my curiosity peaked as to how IO gets queued and processed, slowing down apps.
EDIT: This is NOT about file locking during reads/writes, but about IO locking for the entire storage device. As for HDD vs SDD, it shouldn’t matter since I’m not looking for an upper limit number/speed, but what how the OS or IO device divides its attention between requests. (I am assuming its like CPU threads where an IO device can only handle 1 request at a time). Maybe SSDS can handle multiple at once like multiCores, but lets assume it cannot.
2