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

Vinzent Höfler JeLlyFish.software at gmx.net
Wed Oct 27 23:50:15 CEST 2010


On Wed, 27 Oct 2010 23:42:16 +0200, Andrew Brunner  
<andrew.t.brunner at gmail.com> wrote:

> On Wed, Oct 27, 2010 at 4:37 PM, Vinzent Höfler
> <JeLlyFish.software at gmx.net> wrote:
>> On Wed, 27 Oct 2010 23:26:00 +0200, Andrew Brunner
>> <andrew.t.brunner at gmail.com> wrote:
>>
>> I didn't say "restart", I said "lock out the reader for a moment".
>> Maybe it's easier to grasp if I put it in some pseudo-code:
>>
>> -- 8< --
>> Lock_Readers;
>
> I'm not wanting to place locks all over the place when we have cpu locks.

And I didn't want you to take the code literally. Usually someone
encapsulates such specifics. And well, if you can live with a race
condition that might return momentarily bogus counter values every
couple of hours, you may as well leave them out.

On a 32-bit CPU 64-bit reads are not necessarily atomic, so it won't
matter anyway. :P


Vinzent.



More information about the fpc-devel mailing list