Search code examples
windowsfile-iofilesystemsntfs

When should we use a scatter/gather(vectored) IO?


Windows file system supports scatter/gather IO.(Of course, other platform does)
But I don't know when do I use the IO mechanism.

Could you explain me a proper case?

And what benefit can we get from using the I/O mechanism?(Just a little IO request?)


Solution

  • You use Scatter/Gather IO when you are doing lots of random (i.e. non-sequential) reads / writes, and you want to save on context switches / syscalls - Scatter/Gather is a form of batching in this sense. However, unless you've got a very fast disk (or more likely, a large array of disks), the syscall cost is negligible.

    If you were writing a Database server, you might care about this, but anything less than a big-iron machine handling thousands or millions of requests a second won't see any benefit.