I've been doing some proof of concept work to make the libvirtd daemon
multi-threaded, and this in turns mean that the QEMU / LXC / OpenVZ
drivers need to have some degree of locking on their internal data
structures.
Unforatunately the internal domain/network/storage APIs make extensive
use of linked lists for tracking objects. This makes it incredibly hard
to do fine grained locking of individual objects - eg, deleting one
object requires locking the object it points to, and one the pointing to
it in the linked list, as well as the list itself. This would be so
complex we'd inevitably introduce locking bugs.
So the series of patches which follow replace all linked lists with
explicitly sized arrays. This means I only need 2 levels of locks,
one on the driver object, and one of the domain/network/storage object
being manipulated. The semantics for this are nice & easy to define.
Daniel
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|