From: Keir Fraser Subject: Re: Xen Interdomain Semaphore Date: Tue, 10 Mar 2009 08:21:05 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Timothy Hayes , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 09/03/2009 21:25, "Timothy Hayes" wrote: > I'm working with some data that's been mapped into two virtual machine ad= dress > spaces (this is kernel module code). Right now if I try to manipulate the= data > there are race conditions so naturally I need a constraint like a mutex o= r a > semaphore. I'm not 100% certain, but I'm guessing the Linux kernel semaph= ore > isn't going to work as expected since it puts a process to sleep for a wa= it() > call and wakes a process up for the signal() call. The=A0domain in question > won't be the same domain that created the process. > =A0 > I'm wondering if there is an interdomain semaphore for Xen; maybe someone= has > written one already? Maybe there are some "best practices" when it comes = to > something like this. Any tips would be really appreciated. If you already have shared memory between two domains, it would be easy to implement a spinlock, right? If you want a sleeping semaphore then in addition you need an inter-domain event channel. You can block on that and the 'other end' can wake you by pinging you on it. -- Keir