- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I remember someone said on WIN32, read/set volatile variable willimplicitlycarry a memory fence
but how is it on Linux?
no memory fence when read/set volatile variable?
but how is it on Linux?
no memory fence when read/set volatile variable?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some compilers do that, but it is not and never will be standard behaviour, so don't write nonportable code that will fail with your most likely weapon of choice on Linux (g++). It is a compiler issue rather than an O.S. one, though: if I'm not mistaken, Intel's icc does this on Linux as well as on Windows (configurable?).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting softarts
I remember someone said on WIN32, read/set volatile variable willimplicitlycarry a memory fence
but how is it on Linux?
no memory fence when read/set volatile variable?
but how is it on Linux?
no memory fence when read/set volatile variable?
Yes, gcc does not emit any memory fences for volatile reads/writes.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page