LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Memory fencing at compiler level and hardware level (https://www.linuxquestions.org/questions/linux-newbie-8/memory-fencing-at-compiler-level-and-hardware-level-4175421967/)

prateek.shetty 08-14-2012 02:01 AM

Memory fencing at compiler level and hardware level
 
Hi,

Quote:

asm volatile ("" : : : "memory")
I know that this provides a compiler level memory fence and processor can still do reordering when this is used.

Is there anyway I can achieve both compiler level fencing and processor level fencing with a similar instruction?

I came across,
Quote:

asm volatile("sfence" : : : "memory")
What does this do? Does it provide only compiler level store fencing? :confused:

Any inputs on this will be very helpful.

Thanks


All times are GMT -5. The time now is 07:46 PM.