简体   繁体   中英

I/O Prioritization of Windows OS

I was studying Jeffrey Richter Book (Windows via C/C++). In one section, he is talking about I/O prioritization. I know what is prioritization and what are priority class, priority level, and also a base priority now.

I know, I can change the priority of processes and threads with SetPriorityClass and SetThreadPriority but I can't get understand how I/O priority work in Windows 10 or how priority can help us to fine-tune an app which works with storage based devices that has slow performance.

For example, when I have a thread that works with a storage device, what will happen when I set its priority THREAD_MODE_BACKGROUND_BEGIN? Is that possible to explain it simply? I read this paper completely ( link ) too, but I can't understand the prioritization of I/O.

As noted in that paper, it's up to the I/O device driver to handle priority based on the thread priority, and at the time of that paper, there are only two levels, normal and background, which a device driver may ignore.

A device driver could implement the two levels of priority with two I/O request queues, one for normal priority, the other for background priority. The driver could also include logic to prevent the normal queue from completely locking out the background queue by occasionally handling a request from the background queue based on time or request count, even though the normal queue is not empty.

The paper is an old paper, referring to Vista. By now with Windows 10, there may be more than two levels of I/O priority.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM