libstdc++/5198: 3.0.3 linux x m68k build fail: invalid opcodes in c++locale.cc

Werner Tuchan tuwn@gmx.net
Tue Feb 5 05:48:00 GMT 2002


> if we are turning off interrupts for the whole operation, and nobody
> else can get into __exchange_and_add without turning off interrupts,
> then why bother with the TAS at all?
>
> there's got to be an elegant solution somewhere.  :)
>

TAS is only needed for multiprocessor spinlocks. A second processor could
concurrently enter even with interrupts disabled. This is the only reason
why TAS exists at all otherwise you could just use BSET. TAS is atomic even
on MP machines. Yet it is pretty unlikely that you find any multiprocessor
machines with these CPUs nowadays.

-Werner





More information about the Gcc-bugs mailing list