Increment is not atomic on most processors, including x86 (inc [someAddress] does not exist).Andrei
Umm, inc [address] does exits. However, in order to make it atomic, you're supposed to use the lock prefix. I.e.
ref int atomic_inc(ref int value) {
asm {
lock; // Makes this instruction atomic.
inc [EAX]; // implicit pointer type
//inc int ptr [EAX]; // explicit pointer type
}
}
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos
