Zeng wrote:
Is the assignment operation atomic? That is if one thread assigns to static
variable an object and another uses the object assigned to the variable,
would it be safe?
Assigment should be atomic for single-precision variables. That is, it
may take two instructions (load register from memory; write register
to memory) but the assigned variable is always in either the old state
or the new state, never half way between.
Otoh, this is not true for multiple-precision variables like long or
decimal, and if you're writing for CF, you really don't know what the
native precision is.
Use lock.
--
www.midnightbeach.com