[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#198158: architecture i386 isn't i386 anymore



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 24 June 2003 02:00, Adam Heath wrote:
> On Tue, 24 Jun 2003, "Martin v. Löwis" wrote:
> > In g++ 3.2, this code was distributed as "i386", and nobody noticed that
> > it doesn't work on i386 for quite some time. In gcc 3.3, an
> > implementation is provided that works on i386, and this implementation
> > here is declared i486. Unfortunately, the two implementations are not
> > binary compatible. Debian has to pick one of these, and it needs to pick
> > the i486 version for compatibility with other Linux distributions (which
> > either ship with gcc 3.2 today, or target i586+ only, anyway).
>
> Er, if this function is inlined, then how can it be part of some published
> api?  If it's not part of some published api, then how can using an i386
> variation cause problems with other distributions?

The API requires that access to atomic variables is truly atomic.

The i386 version uses a semaphore to synchronize the access to an atomic
variable, the i486+ version uses the lock prefix. When you mix these
two in one program, two threads might access the variable without
locking against each other because the code inside the semaphore
does not lock the memory bus.

	Arnd <><
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+95p45t5GS2LDRf4RAkJoAJ4xU1jRtxdrvFkh3iserV7AlbOFmwCfd6kw
4ihYAIhj2bMefEpvIcXgu1E=
=BmdC
-----END PGP SIGNATURE-----



Reply to: