On Wed, Mar 16, 2011 at 06:29:30PM +0800, Hu Tao wrote:
virObject is a base struct that manages reference-counting. structs
that need the ability of reference-counting can inherit from
virObject and implement ref/unref interface easily.
The goal of this series is to make reference-counting easy to use,
and improve the current libvir reference-counting mechanism. The
plan is to update all existing structs that use reference-counting
to use virObject if virObject is acceptable.
Patch 1 implements virObject, patch 2 is an illstration of usage of
virObject. This series is in draft stage, any comments are welcome.
I think this is a good idea. I was looking at glib's GObject code
the other day and noticed that they used atomic arithmetic for
lockless reference counting. If its good enough for them, it is
good enough for us too.
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 :|