> concern is corruption of the data or core dump. In my application, it
> is perfectly legal if one thread simply overrides the value set by the
> other threads. I do not want to synchronize the threads to ensure that
> there is no corruption, because this will seriously degrade the
> performance of my algorithm. Thanks in advance.
Have you tested and found that the locking actually did degrade performance?
Write correct code first, optimized code second.
What is it tha you are actually trying to do?
(see "Intel does not guarantee that future processors..." section)
Well, but *what* (if any) MEMORY SYNCHRONIZATION semantics do they
Does NOT look very convincing to me!
("Processors can be instructed to force their memory
caches to agree with main memory..." w.r.t mem.sync
IS JUST PLAIN MS-STYLE-BULLSHIT, AFAIK/AFAICT/IMHO!)
That's rather easy to comprehend... but there are VISIBILITY
issues w.r.t to DEPENDENT objects/data as well:
> I didn't get the rest of your message.
"Relaxed multiprocessor memory models..." -- think of IA64/Windows,
for example, if you just refuse to accept the Intel's lack
of strong/processor ordering guarantees w.r.t to future IA32
multiprocessors... despite the fact that IA32 ALREADY has
memory barriers/fence instructions:
"22.214.171.124. MEMORY ORDERING INSTRUCTIONS
The SSE2 extensions introduce two new fence instructions
(LFENCE and MFENCE) as companions to the SFENCE instruction
introduced with the SSE extensions. The LFENCE instruction
establishes a memory fence for loads. It guarantees ordering
between two loads and prevents speculative loads from passing
the load fence (that is, no speculative loads are allowed
until all loads specified before the load fence have been
The MFENCE instruction combines the functions of the LFENCE
and SFENCE instructions by establishing a memory fence for
both loads and stores. It guarantees that all loads and stores
specified before the fence are globally observable prior to any
loads or stores being carried out after the fence."
Also, you might want to read this:
(atomic operations and ref.counting/thread_shared_ptr)