Re: How to use Volatile on field of type long ?
- From: "Truong Hong Thi" <thi1981@xxxxxxxxx>
- Date: 29 Nov 2005 19:39:18 -0800
>I'm not sure what you mean by "because such things cannot end up in a
>race condition"
I mean such operations are atomic. The bool cannot be partially
updated.
(or rather, why that would mean you *won't* put locking
>in).
I did said access to the var is not synchronized. On multi-processor
box, one thread might not see changes made by other thread. In some
situations, that is not a problem. In situations that matters, I often
lock the call to property instead of lock inside the property. That is
whay I said "I won't".
Thi
.
- References:
- Re: How to use Volatile on field of type long ?
- From: Truong Hong Thi
- Re: How to use Volatile on field of type long ?
- From: Truong Hong Thi
- Re: How to use Volatile on field of type long ?
- From: Jon Skeet [C# MVP]
- Re: How to use Volatile on field of type long ?
- Prev by Date: Re: Color control vs2005
- Next by Date: C# percentile rank algorithm
- Previous by thread: Re: How to use Volatile on field of type long ?
- Next by thread: Dynamic wait on threads
- Index(es):
Relevant Pages
|