Re: [PATCH V11 2/7] Support for atomic operations on integers

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

On 04/17/2012 08:44 AM, Stefan Berger wrote:
> For threading support, add atomic add and sub operations working on
> integers. Base this on locking support provided by virMutex.
> ---
>  src/util/viratomic.h |   91 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 91 insertions(+)
> Index: libvirt-acl/src/util/viratomic.h

> +typedef struct _virAtomicInt virAtomicInt;
> +typedef virAtomicInt *virAtomicIntPtr;
> +
> +struct _virAtomicInt {
> +    virMutex lock;
> +    int value;
> +};

virMutex is very heavyweight.  I'd love it if we could use gcc
primitives and/or MSVC libc primitives (where they are known to be
available), for a lighter-weight implementation on platforms that
support it.  See this patch proposal (now a year old!) for some ideas
that we should fold in before 0.9.12:

Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

libvir-list mailing list

[Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

Powered by Linux