[libvirt] [PATCH v2] Improve on virAtomic implementation

Daniel P. Berrange berrange at redhat.com
Tue Apr 24 14:14:46 UTC 2012


On Tue, Apr 24, 2012 at 10:09:10AM -0400, Stefan Berger wrote:
> On 04/20/2012 11:56 AM, Laine Stump wrote:
> >On 04/20/2012 06:44 AM, Stefan Berger wrote:
> >>This patch improves the previously added virAtomicInt implementation
> >>by using gcc-builtins if possible. The needed builtins are available
> >>since GCC>= 4.1. At least the 4.0 docs don't mention them.
> >>
> >>---
> >>  src/util/viratomic.h |   95
> >>++++++++++++++++++++++++++++++++++++++++++---------
> >>  1 file changed, 79 insertions(+), 16 deletions(-)
> >ACK.
> >
> >Now we can start thinking about eliminating locking for things that just
> >need a refcount :-)
> Of which there aren't too many yet... I'll push this one later
> today. Thanks.

We can't eliminate locking for the objects in general, but we can
eliminate locking in places where we only touch the ref-count, while
keeping the locks for aall other API calls on the object. This
would make like easier for us in a number of places, by avoiding
potential lock aqcuisition order inversion problems we've hit in
the past - particularly in the async callbacks/event dispatch

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list