Preventing unnecessary context switching by employing an indicator associated with a lock on a resource
AssigneeMicrosoft Corporation
InventorsAndrew D. Rogers, Neill M. Clift
Life of this patent
Estimating the term…
Loading patent…
AssigneeMicrosoft Corporation
InventorsAndrew D. Rogers, Neill M. Clift
Estimating the term…
A method of avoiding unnecessary context switching in a multithreaded environment. A thread of execution of a process waiting on a lock protecting access to a shared resource may wait for the lock to be released by executing in a loop, or “spin”. The waiting thread may continuously check, in a user mode of an operating system, an indicator of whether the lock has been released. After a certain time period, the thread may stop spinning and enter a kernel mode of the operating system. Subsequently, before going to sleep which entails costly context switching, the thread may perform an additional check of the indicator to determine whether the lock has been released. If this is the case, the thread returns to user mode and the unnecessary context switching is avoided.
In a computer comprising at least one processor, a method for providing to a plurality of threads access to a resource, the method comprising:
A computer-readable storage device storing computer-executable instructions that, when executed by at least one processor of a computer, cause the computer to perform a method comprising:
A system for providing access to a resource by a plurality of threads, the system comprising:
Dependencies are inferred from the claim text.