Protecting shared resources using shared memory and sockets
First Claim
1. A method of protecting a shared resource in a computing system, comprising:
- storing, in shared memory accessible to at least a first thread and a second thread which execute concurrently in the computing system, a lock data structure for serializing access to the shared resource, the first thread executing under control of a first operating system hosted by the computing system and the second thread executing under control of a second operating system hosted by the computing system; and
upon detecting, by the first thread, that a lock provided by the lock data structure is already held by the second thread, performing, by the first thread;
using a socket to block while waiting for the lock to be released;
adding a waiter entry to a queue, the waiter entry specifying an address of the socket on which the first thread is blocking; and
receiving a notification from the second thread, on the socket, when the second thread releases the lock.
1 Assignment
0 Petitions
Accused Products
Abstract
Shared memory and sockets are used to protect shared resources where multiple operating systems execute concurrently on the same hardware. Rather than using spinlocks for serializing access, when a thread is unable to acquire a shared resource because that resource is already held by another thread, the thread creates a socket with which it will wait to be notified that the shared resource has been released. The sockets may be network sockets or in-memory sockets that are accessible across the multiple operating systems; if sockets are not available, communication technology that provides analogous services between operating systems may be used instead. Optionally, fault tolerance is provided to address socket failures, in which case one or more threads may fall back (at least temporarily) to using spinlocks. A locking service may execute on each operating system to provide a programming interface through which threads can invoke lock operations.
-
Citations
16 Claims
-
1. A method of protecting a shared resource in a computing system, comprising:
-
storing, in shared memory accessible to at least a first thread and a second thread which execute concurrently in the computing system, a lock data structure for serializing access to the shared resource, the first thread executing under control of a first operating system hosted by the computing system and the second thread executing under control of a second operating system hosted by the computing system; and upon detecting, by the first thread, that a lock provided by the lock data structure is already held by the second thread, performing, by the first thread; using a socket to block while waiting for the lock to be released; adding a waiter entry to a queue, the waiter entry specifying an address of the socket on which the first thread is blocking; and receiving a notification from the second thread, on the socket, when the second thread releases the lock. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A system for protecting shared resources in a computing system, comprising:
-
a computer comprising a processor; and instructions which are executable, using the processor, to implement functions comprising; storing, in shared memory accessible to at least a first thread and a second thread which execute concurrently in the computing system, a lock data structure for serializing access to one of the shared resources, the first thread executing under control of a first operating system hosted by the computing system and the second thread executing under control of a second operating system hosted by the computing system; and upon detecting, by the first thread, that a lock provided by the lock data structure is already held by the second thread, performing, by the first thread; using a socket to block while waiting for the lock to be released; adding a waiter entry to a queue, the waiter entry specifying an address of the socket on which the first thread is blocking; and receiving a notification from the second thread, on the socket, when the second thread releases the lock. - View Dependent Claims (9, 10, 11)
-
-
12. A computer program product for protecting shared resources in a computing system, the computer program product comprising:
a computer readable storage medium having computer readable program code embodied therein, the computer readable program code configured for; storing, in shared memory accessible to at least a first thread and a second thread which execute concurrently in the computing system, a lock data structure for serializing access to one of the shared resources, the first thread executing under control of a first operating system hosted by the computing system and the second thread executing under control of a second operating system hosted by the computing system; and upon detecting, by the first thread, that a lock provided by the lock data structure is already held by the second thread, performing, by the first thread; using a socket to block while waiting for the lock to be released; adding a waiter entry to a queue, the waiter entry specifying an address of the socket on which the first thread is blocking; and receiving a notification from the second thread, on the socket, when the second thread releases the lock. - View Dependent Claims (13, 14, 15, 16)
Specification