[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] PATCH: 8/25: Concurrent dispatch of RPC methods



On Thu, Jan 15, 2009 at 05:22:52PM +0000, Daniel P. Berrange wrote:
> On Thu, Jan 15, 2009 at 05:07:01PM +0000, Richard W.M. Jones wrote:
> > On Tue, Jan 13, 2009 at 05:41:48PM +0000, Daniel P. Berrange wrote:
> > > +    /* Get a unique serial number for this message. */
> > > +    rv->serial = priv->counter++;
> > 
> > This (and similar) are safe because we hold the remoteDriverLock until
> > we enter the actual call?
> 
> That is correct - the first thing all the public API entry points do
> is grab the lock. 
> 
> The lock is only then released, when the main thread is waiting on I/O
> in the poll() call:
> 
> +        remoteDriverUnlock(priv);
> +            
> +    repoll:
> +        ret = poll(fds, ARRAY_CARDINALITY(fds), -1);
> +        if (ret < 0 && errno == EINTR)
> +            goto repoll;
> +        remoteDriverLock(priv);
> 
> 
> Or when additional threads are sleeping on the condition variable.

+1 then.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]