Home » U++ Library support » U++ MT-multithreading and servers » Again ReadMemoryBarrier() etc
Re: Again ReadMemoryBarrier() etc [message #10431 is a reply to message #10418] |
Mon, 09 July 2007 09:49   |
 |
mirek
Messages: 14261 Registered: November 2005
|
Ultimate Member |
|
|
Sorry, but this is the complete misunderstanding of the issue from several points of view.
First of all, these intrinsics are about COMPILER reordering! The do not emit any instructions, they just tell the compiler not to perform certain optimizations.
Second, they are not available on GCC and they behave differently on previous MSC versions.
Third, lfence / sfence are SSE instructions and believe or not, we still have to support CPUs without SSE.
Fourth, the idea that "the _WriteBarrier function forces writes to memory to complete at the point of the call. After the call, other threads can access the memory without fear that the thread that made the call might have a pending write to the memory." is wrong as well, even if you would thing that it emits actual CPU write barrier. This is not what a write barrier does for you... (but your mistake is quite understandable, because I was under this false impression too a couple of months ago....)
Mirek
|
|
|
Goto Forum:
Current Time: Tue Jun 17 11:00:44 CEST 2025
Total time taken to generate the page: 0.04531 seconds
|