Daniel O'Connell [C# MVP] <onyxkirx@--NOSPAM--comcast.net> wrote:[color=blue][color=green]
> > It should do - otherwise you can still have problems, if (for instance)
> > another thread has a variable value cached in a register.[/color]
>
> Good point, perhaps a more limited memory barrier, no processor cache flush,
> just a register flush to processor cache?[/color]
Possibly - but then couldn't MemoryBarrier do the same thing?
[color=blue]
> Thats conjecture mostly, I have no clue how the performance of sync
> primatives work, other than his machine does is not the same as what mine
> does.[/color]
Right. For the record, here are the results on my single processor
Pentium-M laptop:
baseline = 00:00:00.0388890
volatile_int = 00:00:00.0393999
Memory Barriers = 00:00:00.2775134
VolatileMethods = 00:00:00.6350966
locked = 00:00:00.3517676
Interlocked = 00:00:00.1730569
Interesting to see that your baseline and volatile int are better than
mine, but all the rest of mine are better than yours. Odd.
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too