[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v2 1/2] add a header file for atomic operations

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 1/2] add a header file for atomic operations
Date: Tue, 18 Jun 2013 13:03:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

Il 18/06/2013 10:36, Paolo Bonzini ha scritto:
>     Important Note: Note that it is important for both threads to access
>     the same volatile variable in order to properly set up the happens-before
>     relationship. It is not the case that everything visible to thread A
>     when it writes volatile field f becomes visible to thread B after it
>     reads volatile field g. The release and acquire have to "match" (i.e.,
>     be performed on the same volatile field) to have the right semantics. 
> Is this final "important note" the difference between ACQ_REL and SEQ_CST?

Based on what I read now, I think I want ACQ_REL for
atomic_mb_{read,set}.  One can still get SEQ_CST with atomic_xchg (for
sets) or atomic_add (adding 0, for reads).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]