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] | |
On Wed, May 04, 2005 at 02:47:14PM -0600, Chris Friesen wrote:
In multiple messages to comp.programming.threads he has stated that volatile is not necessary between threads if you use the posix locking functions, and in fact that one of the main purposes of the posix locks is to ensure correct memory visibility between threads.
That still assumes that the compiler isn't pulling the body of pthread_mutex_lock, deciding that it doesn't really clobber any globals and proceeding to consider it a read-only function. At this point in time, and for the foreseeable future this will remain to be true.
The real future-proof fix is to mark them as such and have the compiler recognize that attribute. This means adding concurrency semantics to the compiler. Something that we are in the process of doing.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |