Re: memory barrier ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 12 Nov 2002, David Dufresne wrote:

> > There are two things to the barrier. One is to make sure CPU does not
> > prefetch the old value and another is to make sure, that compiler does
> > not reorder the statements!
> > 
> The first one is a hardware memory barrier:
> #define mb()    __asm__ __volatile__ ("lock; addl $0,0(%esp)": : :"memory")

sfence, mfence, lfence ops on newer processors too.

	Zwane
-- 
function.linuxpower.ca

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux