[fpc-devel] Re: systemh.inc InterLockedIncrement64 (var Target: int64)

Andrew Brunner andrew.t.brunner at gmail.com
Wed Oct 27 23:26:00 CEST 2010


On Wed, Oct 27, 2010 at 4:16 PM, Vinzent Höfler
<JeLlyFish.software at gmx.net> wrote:
> Are you counting up only? Then you can use the 32-bit version of the
> InterlockedIncrement on the lower word only. If this turns out to be zero
> (the new value is returned) after the operation, you know you also have to
> increment the high word. Even with 30'000 transactions per second it takes
> about 9 hours until the lower word will be zero again, so the probability
> of a race condition happening here is very close to zero.

Yes.  Only counting up in this case *but* one of my other stats is
UPTIME.  Meaning we want to brag about how long the application is
running w/o re-starting :-)  So restarting the app every time the
counter rolls over, just isn't feasible for this application.



More information about the fpc-devel mailing list