0
我想設置的文件IO在不改變線程的優先級低優先級,於是我就用SetFileInformationByHandle象下面這樣:SetFileInformationByHandle與IO優先工作不正常
FILE_IO_PRIORITY_HINT_INFO priorityHint;
priorityHint.PriorityHint = IoPriorityHintVeryLow;
bool result = SetFileInformationByHandle(desHandle,
FileIoPriorityHintInfo,
&priorityHint,
sizeof(priorityHint));
,我喜歡這樣創建文件:
HANDLE desHandle = CreateFile(desPath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
每次我寫4KB數據desHandle這樣的:
while()
{
....
if (!WriteFile(desHandle, startPtr, numOfEachWrite, reinterpret_cast<LPDWORD> (&numOfBytesWritten), NULL))![enter image description here][1]
{}
...
}
但當我使用進程監視器僅查找低優先級的第一個4kb數據時,所有其他優先級均爲正常優先級