Ross Levis wrote: > Even with a dual processor and each thread running on a separate > processor, > is it possible for one memory location to be written precisely at the > same > time?
No, however be sure it _will_ make trouble. Since incrementing is not atomic. There are three atomic steps necessary, after each step a thread switch may occur: - Read the value from memory into a processor register. - Add 1 to processor register. - Write contents of processor register back to memory. So you can imagine what will happen if the other thread reads or writes the value while these steps are not finished yet :) I think the fastes way to synchronize would be using calls to Windows.InterlockedDecrement() and Windows.InterlockedIncrement(). Arno Garrels _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

