Re: When is "volatile" used instead of "lock" ?
- From: "Peter Ritchie [C#MVP]" <prsoco@xxxxxxxxxxxxxxxxx>
- Date: Mon, 16 Jul 2007 16:47:48 -0400
I'd be interested in the disassembly if you can post it, it's going to take
me a while to get access to an IA64...
I should have asked this at the same time: does the "myValue = new
LazyInitClass();" code cause to emit an instruction with a "rel" completer?
Without that, one processor could have executed that instruction and has yet
to call Monitor.Exit while another processor is executing the read of
"myValue".
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:uC$NCU%23xHHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
<snip>
Yes I do and it's not emitting a ld.acq on IA64, the memory read has no
acquire semantics on X86/X64 either, but this is not relevant in case of
Vance's sample (fig 7) . What makes this work in V2. (as explained in
Vance's article you are referring to) is the strong write ordering in V2's
memory model, this irrespective the underlying HW platform.
.
- References:
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Jon Skeet [C# MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Jon Skeet [C# MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Jon Skeet [C# MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Jon Skeet [C# MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Jon Skeet [C# MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Jon Skeet [C# MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Willy Denoyette [MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Peter Ritchie [C#MVP]
- Re: When is "volatile" used instead of "lock" ?
- From: Willy Denoyette [MVP]
- Re: When is "volatile" used instead of "lock" ?
- Prev by Date: Re: When is "volatile" used instead of "lock" ?
- Next by Date: Re: Initializing a dictionary
- Previous by thread: Re: When is "volatile" used instead of "lock" ?
- Next by thread: Re: When is "volatile" used instead of "lock" ?
- Index(es):
Relevant Pages
|