11/11/2023 0 Comments Keacquirespinlock reactos![]() Here at OSR, we’ve been using them on OS versions as early as Windows 7 without any problem. Reader/Writer Spin Locks are wonderful additions to the driver writer’s tool chest. Because they’re spin locks, they can be acquired at IRQLs less than or equal to DISPATCH_LEVEL. These locks are just what their name implies: they are spin locks that can be acquired in either shared mode (for reading, but not modifying, shared data) or exclusive mode (for reading and modifying shared data). The WDK for Windows 8 tells us that starting in Vista SP1, Windows includes support for Reader/Writer Spin Locks. That is, there hasn’t been one until the introduction of the WDK for Windows 8. And there hasn’t been any sort of reader/writer lock documented as being available for use at IRQL DISPATCH_LEVEL. That pretty much leaves them out of contention as a possible solution for most device driver work. One problem with ERESOURCES is that they can only be used in code running at less than IRQL DISPATCH_LEVEL. Because ERESOURCES allow multiple simultaneous readers of a given data area but only a single writer, this category of lock is most often referred to as a reader/writer lock. When acquired exclusive, the lock ensures that there’s only one accessor to a data area and thus allows the data to be updated atomically. When acquired shared, the lock allows multiple threads to simultaneously read from a data area. Over the years, I’ve particularly lusted over ERESOURCES.ĮRESOURCES are locks that can be acquired in either shared mode or exclusive mode. However, I do admit that sometimes, just sometimes, I get a bit jealous over the variety of locking choices available to devs who never have to be concerned about running at IRQL DISPATCH_LEVEL or higher. It’s plain fact that the life of a device driver writer is easy in some ways. In the land of device drivers, all pool is nonpaged and all locks are spin.” ![]() “You should switch to writing device drivers,” I tell them. ![]() I regularly enjoy teasing my file system developer colleagues over the pain they suffer about whether some structure should be stored in paged pool or nonpaged pool or exactly which type of locking primitive they should use for a particular task. Last reviewed and updated: 10 August 2020 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |