Show quoted text 7 lines
?
I think it can be implemented easily using
InterlockedCompareExchange,
no?
Yes it will be but to my knowledge there exists no platform independent version of InterlockedCompareExchange in Free Pascal...and even none for 64Bit.
For a new memory manager there must be a lowlevel function supporting this.
Also this operation must not be reordered/optimized by the compiler.
The operation should preferrably be a
InterlockedCompareExchangePointer()
wich always does the right thing :-) depending on architecture ...
For the interested ...
http://en.wikipedia.org/wiki/Compare-and-swap
http://groups.google.de/group/comp.programming.threads/browse_frm/thread /d062e1bfa460a375/3461ab7dd927a6ec?group=comp.programming.threads#3461ab 7dd927a6ec
helmut
