On Fri, 2006-04-21 at 18:22 +0200, Jens-Heiner Rechtien wrote:
> I can't see what we could do about the costs of the "lock" instruction 
> on x86. I mean, if we need an atomic increment/decrement for our 
> reference counter we can't work with non-atomic instructions here, 
> especially now when multi-processor/multi-core PCs are entering the 
> mainstream.

There are still a lot of people using older x86 machines.

Can't you check the system processor mask on startup and have your
inlined asm conditionally run locked or non-locked instructions
accordingly. The overhead of the test is still much much less than the
lock overhead on uni-processor systems.

This is what I've done in pthreads-win32 and it seems to work in
practise. Nobody has complained or suggested that the concept is
invalid.

Ross


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to