Operating system providing a mutual exclusion mechanism
First Claim
1. An apparatus comprising a processor and a memory storing computer program code, wherein the memory and stored computer program code are configured, with the processor, to cause the apparatus to at least:
- implement a scheduler incorporating an algorithm for ordering the running of threads of execution having different priorities, the scheduler maintaining a ready list of threads which are scheduled to run on the device, ordered by priority; and
implement at least one locking mechanism configured to block access to a resource from all threads except for a thread that holds the locking mechanism,wherein the at least one locking mechanism comprises a mutex including a pointer, the pointer included in the mutex pointing to the thread holding the mutex or being null if the mutex is free, the mutex further including a flag indicating whether or not the mutex is contested, andwherein in an instance in which the scheduler selects a thread on the ready list to run, but the selected thread is blocked from running because a resource it requires is blocked, the scheduler does not switch to the blocked thread but retains the blocked thread in its place by priority on the ready list and instead yields to the thread which holds the locking mechanism and causes the thread which holds the locking mechanism to run.
3 Assignments
0 Petitions
Accused Products
Abstract
An operating system for a computing device includes a scheduler incorporating an algorithm for ordering the running of threads of execution having different priorities. The operating system is also arranged to provide a list of threads which are scheduled to run on the device, ordered by priority. At least one locking mechanism for docking access to a resource of the device from all threads except for a thread that holds the locking mechanism is also provided, and the operating system arranges for a scheduled thread which is docked from running because the resource it requires is locked to cause the thread which holds the locking mechanism to run.
24 Citations
29 Claims
-
1. An apparatus comprising a processor and a memory storing computer program code, wherein the memory and stored computer program code are configured, with the processor, to cause the apparatus to at least:
-
implement a scheduler incorporating an algorithm for ordering the running of threads of execution having different priorities, the scheduler maintaining a ready list of threads which are scheduled to run on the device, ordered by priority; and implement at least one locking mechanism configured to block access to a resource from all threads except for a thread that holds the locking mechanism, wherein the at least one locking mechanism comprises a mutex including a pointer, the pointer included in the mutex pointing to the thread holding the mutex or being null if the mutex is free, the mutex further including a flag indicating whether or not the mutex is contested, and wherein in an instance in which the scheduler selects a thread on the ready list to run, but the selected thread is blocked from running because a resource it requires is blocked, the scheduler does not switch to the blocked thread but retains the blocked thread in its place by priority on the ready list and instead yields to the thread which holds the locking mechanism and causes the thread which holds the locking mechanism to run. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
-
-
16. A method comprising:
-
providing a scheduler incorporating an algorithm for ordering the running of threads of execution having different priorities, the scheduler maintaining a ready list of threads which are scheduled to run on a computing device, ordered by priority; and providing at least one locking mechanism configured to block access to a resource of the device from all threads except for a thread that holds the locking mechanism, wherein the at least one locking mechanism comprises a mutex including a pointer, the pointer included in the mutex pointing to the thread holding the mutex or being null if the mutex is free, the mutex further including a flag indicating whether or not the mutex is contested, and wherein in an instance in which the scheduler selects a thread on the ready list to run, but the selected thread is blocked from running because a resource it requires is blocked, the scheduler does not switch to the blocked thread but retains the blocked thread in its place by priority on the ready list and instead yields to the thread that holds the locking mechanism and causes the thread that holds the locking mechanism to run. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)
-
-
29. A non-transitory computer-readable storage medium storing computer program code for an operating system for a computing device, the operating system comprising:
-
a scheduler incorporating an algorithm for ordering the running of threads of execution having different priorities, the scheduler configured to maintain a ready list of threads which are scheduled to run on the device, ordered by priority; and at least one locking mechanism configured to block access to a resource of the device from all threads except for a thread that holds the locking mechanism, wherein the at least one locking mechanism comprises a mutex including a pointer, the pointer included in the mutex pointing to the thread holding the mutex or being null if the mutex is free, the mutex further including a flag indicating whether or not the mutex is contested, and wherein in an instance in which the scheduler selects a thread on the ready list to run, but the selected thread is blocked from running because a resource it requires is blocked, the scheduler is configured to not switch to the blocked thread but retain the blocked thread in its place by priority on the ready list and instead yield to the thread that holds the locking mechanism and cause the thread that holds the locking mechanism to run.
-
Specification