Re: Is gcc thread-unsafe?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bart Van Assche
Date: Friday, October 26, 2007 - 10:07 am

On 10/26/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:

You have a point here.


A problem is that the serialization properties defined for functions
in the C standard only apply to volatile variables, not to
non-volatile variables. But for asm statements this can be solved by
adding memory to the list of clobbered registers -- this will prevent
any reordering of manipulations of non-volatile variables and asm
statements.

Andrew, do you know whether gcc currently contains any optimization
that interchanges the order of accesses to non-volatile variables and
function calls ?


I agree with the above, but I see this as a different issue -- it
wasn't my intention to solve this with my proposal for acquire and
release attributes.

Bart Van Assche.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Is gcc thread-unsafe?, Bart Van Assche, (Fri Oct 26, 7:40 am)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Fri Oct 26, 8:09 am)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Fri Oct 26, 8:27 am)
Re: Is gcc thread-unsafe?, Andrew Haley, (Fri Oct 26, 8:34 am)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Fri Oct 26, 9:28 am)
Re: Is gcc thread-unsafe?, Bart Van Assche, (Fri Oct 26, 10:07 am)
Re: Is gcc thread-unsafe?, Andrew Haley, (Fri Oct 26, 10:12 am)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Fri Oct 26, 10:25 am)
RE: Is gcc thread-unsafe?, David Schwartz, (Fri Oct 26, 11:06 am)
Re: Is gcc thread-unsafe?, Alan Cox, (Fri Oct 26, 11:08 am)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Fri Oct 26, 11:14 am)
Re: Is gcc thread-unsafe?, Andi Kleen, (Fri Oct 26, 1:39 pm)
Re: Is gcc thread-unsafe?, Giacomo Catenazzi, (Fri Oct 26, 2:45 pm)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Fri Oct 26, 3:24 pm)
RE: Is gcc thread-unsafe?, Andrew Haley, (Tue Oct 30, 3:20 am)
Re: Is gcc thread-unsafe?, Bart Van Assche, (Fri Nov 2, 8:29 am)
Re: Is gcc thread-unsafe?, Andrew Haley, (Fri Nov 2, 8:38 am)
RE: Is gcc thread-unsafe?, David Schwartz, (Fri Nov 2, 10:18 am)
Re: Is gcc thread-unsafe?, Bart Van Assche, (Sun Nov 4, 8:13 am)
Re: Is gcc thread-unsafe?, Linus Torvalds, (Sun Nov 4, 10:45 am)
Re: Is gcc thread-unsafe?, Andrew Haley, (Sun Nov 4, 10:58 am)
Re: Is gcc thread-unsafe?, Bart Van Assche, (Sun Nov 4, 11:06 am)