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

Eric Blake eblake at redhat.com
Thu Apr 19 18:26:41 UTC 2012


On 04/19/2012 12:19 PM, Stefan Berger wrote:
> On 04/19/2012 02:08 PM, Eric Blake wrote:
>> 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.
>>
>> 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:
>>
>> https://www.redhat.com/archives/libvir-list/2011-April/msg00368.html
>>
> Well, I wasn't aware of this previous proposal and had actually looked
> in pthread for some form of atomic support.
> I already pushed this patch now. We can add some compiler- and
> architecture-specific #ifdef's around the few existing functions. So the
> existing implementation probably has a place but can be improved upon.

No problem with the current implementation (don't go reverting anything
just because I came late to the review party!); I'm okay with future
patches for the improvements, especially since they will merely be
optimizations.  But I'm hoping we can get those optimizations in the
tree before 0.9.12, rather than later, now that it is fresh on our minds.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120419/1eac22d7/attachment-0001.sig>


More information about the libvir-list mailing list