Re: [ntdev] Will THREAD_MODE_BACKGROUND_BEGIN work for kernel mode thread?

The behaviour in this area changed in recent versions and has been dependent on which kernel was loaded (UP versus MP). Priority boost to 31 was never implemented, but boosting the owner of a mutex to the priority of a waiter has. In KM, raising to dispatch (ie acquiring a spin lock) is effectively like raising to 31 because the code becomes un-promptable (except for interrupts).

None of this has anything to do with the merits of Windows versus *nix, but is merely a reflection of the realities of Windows implementation and its history

Sent from Surface Pro

From: xxxxx@hotmail.com
Sent: ‎Wednesday‎, ‎July‎ ‎16‎, ‎2014 ‎6‎:‎58‎ ‎PM
To: Windows System Software Devs Interest List

I don’t think it does. Windows scheduler knows when a higher priority thread is waiting for
a mutex and this lets it bump the owning thread to the waiter’s priority. That’s the only thing that’s needed.



Well, you seem to go further than even Dr.Joe himself - according to him, Windows just boosts the priority of mutex owner to 31, which is a priority ceiling protocol (not a “hack” as Dr.Joe thinks but, instead, a fully workable solution from the world of hard-realtime design). You seem to go even further than that - you are speaking about boosting owner’s priority to that of higher-priority waiter, which is already a priority-inheritance protocol. Which OS are you speaking about, guys??? Look - both priority ceiling and priority-inheritance protocols firmly belong in the world of RTOSes and are virtually unheard of in the world of GPOSes, simply because they have very specific use and are subjected to the requirements that GPOSes normally don’t meet. In order to make the above protocols work for you you have to ensure that mutex owner never ever enters unbounded wait (i.e a wait on some construct other than RT mutex) - you cannot avoid priority inheritance if you rely upon semaphores, completions, RW locks and other dispatcher constructs that are widely used by drivers in GPOSes …

Anton Bassov


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer