摘要 |
Shared memory and sockets are used to protect shared resources in an environment where multiple operating systems execute concurrently on the same hardware. Rather than using spinlocks for serializing access to the shared resources, when a thread is unable to acquire a shared resource because that resource is already held by another thread, the thread that was unable to acquire the resource 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 in a particular implementation, communication technology that provides analogous services between operating systems may be used instead. In an optional aspect, fault tolerance is provided to address socket failures, in which case one or more threads may fall back (at least temporarily) to using spinlocks. As another option, a locking service may execute on each operating system to provide a programming interface through which threads can invoke operations for holding and releasing the lock.
|