> >> > >> Does the Codegenerator already support this? > >> Are they portable? > >> How would you suggest to implement such operations platform > independent? > > > > I don't think this is possible, as it depends on processor support ? > > 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 _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel