This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimization of conditional access to globals: thread-unsafe?


On 10/29/07, Tomash Brechko <tomash.brechko@gmail.com> wrote:
> But if *v is simply shared, do all stores to it matter?  No, only the
> final value is relevant.

Actually it depends, it might matter.  If you have a loop checking the
value of *v on a different thread and it does not change until this
loop is done, then you end up with a wrong wait.  This is the same as
what violatile is for really where it will change out side of the
current thread.

-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]