POV-Ray : Newsgroups : povray.off-topic : My hypothesis : Re: My hypothesis Server Time
29 Jul 2024 20:25:02 EDT (-0400)
  Re: My hypothesis  
From: Darren New
Date: 15 Sep 2011 22:03:14
Message: <4e72ae62$1@news.povray.org>
On 9/14/2011 13:54, Orchid XP v8 wrote:
>> If it's automatic, why do x86 CPUs have memory fence instructions?
> I'm guessing that's for performance, not correctness.

http://software.intel.com/en-us/forums/showthread.php?t=65071

It appears at first google that you are correct. On second google,

http://siyobik.info/main/reference/instruction/LFENCE

I think what's happening is that I might write instructions that store 
things out of order, so I store something in a memory address, then store a 
pointer to that address some place you will look. On the x86 at least, the 
memory fence is necessary to make sure that I have stored the data before I 
have stored the pointer to it. You will always fetch the most recent pointer 
I have stored, but executing "store data ; store pointer" might store the 
pointer before the data without a fence. So it's not caches of main memory 
but caches of instruction results that's the issue I was thinking of.

-- 
Darren New, San Diego CA, USA (PST)
   How come I never get only one kudo?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.