Composite lock for computer systems with multiple domains
First Claim
1. In a computer system that has a hardware platform, a software platform and a plurality of processes running in user-defined domains, a lock comprising:
- A) a platform-dependent lock component that operates as a semaphore with a wait function and a signal function;
B) a front-end lock component comprising computer instructionsi) for acquiring the lock by performing a first operation on a variable, which indicates how many of the processes currently hold or wish to acquire the lock,a) by atomically changing the variable by a first predetermined amount as part of the first operation; and
b) by calling the wait function of the platform-dependent lock component if the variable meets a first comparison condition relative to a predetermined first threshold value,ii) for releasing the lock by performing a second operation on the variablea) by atomically changing the variable by a second predetermined amount as part of the second operation; and
b) by calling the signal function of the platform-dependent lock component if the variable meets a second comparison condition relative to a predetermined second threshold value;
C) the processes calling the front-end lock component in order to acquire the lock regardless of the domain in which each process is currently executing;
D) the platform-dependent lock component and the front-end lock component being accessible from different domains;
E) only one of the processes at a time thereby being allowed to acquire the lock.
2 Assignments
0 Petitions
Accused Products
Abstract
In a multi-domain computer system in which several processes are running, a composite lock provides mutually exclusive access to a resource. The composite lock has a back-end component and a front-end component. The back-end component is platform-dependent and operates as a semaphore, with Wait and Signal functions. The front-end component conditionally calls the Wait and Signal functions depending on whether the lock is currently contested when a new process wishes to acquire the lock, and on whether any process is currently suspended, waiting to acquire the lock. The front-end and back-end components may execute in different domains. In the uncontested case, the invention avoids costly domain crossings. The front-end component may also include a spinning feature to further reduce the need to invoke the back-end component and cause a domain crossing. The composite lock is particularly advantageous in computer systems that include a virtual machine.
99 Citations
40 Claims
-
1. In a computer system that has a hardware platform, a software platform and a plurality of processes running in user-defined domains, a lock comprising:
-
A) a platform-dependent lock component that operates as a semaphore with a wait function and a signal function; B) a front-end lock component comprising computer instructions i) for acquiring the lock by performing a first operation on a variable, which indicates how many of the processes currently hold or wish to acquire the lock, a) by atomically changing the variable by a first predetermined amount as part of the first operation; and b) by calling the wait function of the platform-dependent lock component if the variable meets a first comparison condition relative to a predetermined first threshold value, ii) for releasing the lock by performing a second operation on the variable a) by atomically changing the variable by a second predetermined amount as part of the second operation; and b) by calling the signal function of the platform-dependent lock component if the variable meets a second comparison condition relative to a predetermined second threshold value; C) the processes calling the front-end lock component in order to acquire the lock regardless of the domain in which each process is currently executing; D) the platform-dependent lock component and the front-end lock component being accessible from different domains; E) only one of the processes at a time thereby being allowed to acquire the lock. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. In a computer system that has a hardware platform, a software platform, a resource and a plurality of user-defined domains, a lock for controlling access to the resource by a plurality of processes, the lock comprising:
-
A) a platform-dependent lock component that operates as a semaphore with a wait function and a signal function; B) a front-end lock component comprising computer instructions i) for acquiring the lock and granting access to the resource by performing a fetch-and-increment operation on a variable, which indicates how many of the processes currently hold or wish to acquire the lock, a) by atomically changing the variable by a first predetermined amount as part of the first operation; and b) by calling the wait function of the platform-dependent lock component if the variable meets a first comparison condition relative to a predetermined first threshold value, ii) for releasing the lock by performing a fetch-and-decrement operation on the variable a) by atomically changing the variable by a second predetermined amount as part of the second operation; and b) by calling the signal function of the platform-dependent lock component if the variable meets a second comparison condition relative to a predetermined second threshold value; C) the processes calling the front-end lock component in order to acquire the lock and access the resource regardless of the current domain in which each process is currently executing; D) the platform-dependent lock component and the front-end lock component being accessible from different domains; E) only one of the processes at a time thereby being allowed to hold the lock; in which; F) the first comparison condition is that the variable indicates that at least one of the processes currently holds or wishes to acquire the lock; and G) the second comparison condition is that the variable indicates that at least one of the processes wishes to acquire the lock in addition to the process that currently holds the lock.
-
-
10. A computer system comprising:
-
a host hardware platform; host software that includes a platform-provided lock component; a virtual machine (VM); a virtual machine monitor that forms a software interface between the VM and the host hardware platform; a plurality of user-defined domains including a host domain and a VM domain; a composite lock that has a front-end component that is accessible to processes running in both the host domain and the VM domain and that conditionally calls the platform-provided lock component in the case of contention for the composite lock. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18, 19, 20)
-
-
21. In a computer system that has a hardware platform, a software platform and a plurality of user-defined domains, a method for controlling concurrently running processes comprising:
-
A) running as a semaphore a platform-dependent lock component with a wait function and a signal function; B) running a front-end lock component to include the following sub-steps; i) acquiring the lock by performing a first operation on a variable, which indicates how many of the processes currently hold or wish to acquire the lock, a) by atomically changing the variable by a first predetermined amount as part of the first operation; and b) by calling the wait function of the platform-dependent lock component if the variable meets a first comparison condition relative to a predetermined first threshold value, ii) releasing the lock by performing a second operation on the variable a) by atomically changing the variable by a second predetermined amount as part of the second operation; and b) by calling the signal function of the platform-dependent lock component if the variable meets a second comparison condition relative to a predetermined second threshold value; C) processes calling the front-end lock component in order to access the resource regardless of the current domain in which each process is currently executing; D) the platform-dependent lock component and the front-end lock component being accessible from different domains; E) thereby allowing only one of the processes at a time to acquire the lock. - View Dependent Claims (22, 23, 24, 25, 26, 27, 28)
-
-
29. In a computer system that has a hardware platform, a software platform and a plurality of user-defined domains, a method for controlling concurrently running processes comprising:
-
A) running as a semaphore a platform-dependent lock component with a wait function and a signal function; B) running a front-end lock component to include the following sub-steps; i) acquiring the lock by performing a fetch-and-increment operation on a variable, which indicates how many of the processes currently hold or wish to acquire the lock, a) by atomically changing the variable by a first predetermined amount as part of the first operation; and b) by calling the wait function of the platform-dependent lock component if the variable meets a first comparison condition relative to a predetermined first threshold value, in which the first comparison condition is that the variable indicates that at least one of the processes currently holds or wishes to acquire the lock; ii) releasing the lock by performing a fetch-and-decrement operation on the variable a) by atomically changing the variable by a second predetermined amount as part of the second operation; and b) by calling the signal function of the platform-dependent lock component if the variable meets a second comparison condition relative to a predetermined second threshold value, in which the second comparison condition is that the variable indicates that at least one of the processes wishes to acquire the lock in addition to the process that currently holds the lock; C) processes calling the front-end lock component in order to access the resource regardless of the current domain in which each process is currently executing; D) the platform-dependent lock component and the front-end lock component being accessible from different domains; E) thereby allowing only one of the processes at a time to acquire the lock.
-
-
30. In a computer system that has a host hardware platform, a host software platform, a virtual machine monitor running on the hardware platform, and a virtual machine (VM) running on the virtual machine monitor, a method for controlling concurrently running processes comprising:
-
defining a plurality of domains, including a host domain and a VM domain; and running a composite lock that has a front-end component that is accessible to processes running in both the host domain and the VM domain and that conditionally calls a platform-provided lock component in the case of contention for the composite lock. - View Dependent Claims (31, 32, 33, 34, 35, 36, 37, 38, 39, 40)
-
Specification