Boost logo

Boost :

Subject: Re: [boost] [atomic] unconditional cmpxchg8b support
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-10-23 18:01:11

On Oct 24, 2012 1:22 AM, "Peter Dimov" <lists_at_[hidden]> wrote:
> Steven Watanabe wrote:
>> Seriously, if the compiler is set to compile for
>> an architecture that doesn't support cmpxchg8b,
>> then Boost.Atomic should not generate this instruction.
> It's very, very rare for a user to willingly target 386/486 (these
processors are all but extinct, not to mention that modern Windows versions
simply don't run on them.)

Windows is not the only OS Boost supports.

> A GCC target of i386 in practice simply means that a target hasn't been
set, not that the user explicitly wanted to target i386. Nobody wants to
target i386.

The library should not make this assumption. Unless the library explicitly
requires particular hardware to run on in the docs, it should compile and
run on any CPU.

Whether or not Boost.Atomic should require cmpxchg8b on x86 is a valid
question. If it does require that, the library should not compile for a
target not meeting that requirement. The user should be made aware that the
library does not support that target. IMO, it is not acceptable to silently
compile the code that requires higher hw capabilities than specified by
compiler, however unusual they may be.

IMHO, there is no hard requirement of cmpxchg8b on x86. Most of the library
is still useful without it.

Boost list run by bdawes at, gregod at, cpdaniel at, john at