Does SetFileBandwidthReservation affect memory-mapped file performance?

Posted by Ghostrider on Stack Overflow See other posts from Stack Overflow or by Ghostrider
Published on 2010-06-11T07:36:29Z Indexed on 2010/06/13 9:52 UTC
Read the original article Hit count: 304

Does this function affect Memory-mapped file performance?

Here's the problem I need to solve:

I have two applications competing for disk access: "reader" and "updater". Whole system runs on Windows Server 2008 R2 x64

"Updater" constantly accesses disk in a linear manner, updating data. They system is set up in such a way that updater always has infinite data to update. Consider that it is constantly approximating a solution of a huge set of equations that takes up entire 2TB disk drive. Updater uses ReadFile and WriteFile to process data in a linear fashion.

"Reader" is occasionally invoked by user to get some pieces of data. Usually user would read several 4kb blocks from the drive and stop. Occasionally user needs to read up to 100mb sequentially. In exceptional cases up to several gigabytes. Reader maps files to memory to get data it needs.

What I would like to achieve is for "reader" to have absolute priority so that "updater" would completely stop if needed so that "reader" could get the data user needs ASAP.

Is this problem solvable by using SetPriorityClass and SetFileBandwidthReservation calls?

I would really hate to put synchronization login in "reader" and "updater" and rather have the OS take care of priorities.

© Stack Overflow or respective owner

Related posts about Windows

Related posts about Performance