Pass 2.3

Andrei Alexandrescu andrei at metalanguage.com
Sun Sep 12 02:00:09 BST 2004


I now start feeling sorry for having added that paragraph :o).

I thought this is a more widespread problem. Basically reading a full word,
masking, and writing a word is how all RISCs do byte-level updates. Now the
question is if that's atomic or not. My suspicion was that (1) some
processors choose the faster path to make atomicity an option, and (2) some
compilers know that non-atomic is slower so they generate three instructions
to do things "by hand" if they assume single-threading.

Likely I was wrong. I now am sorry about adding a not-so-relevant
paragraph...


Andrei

----- Original Message ----- 
From: "Hans Boehm" <Hans.Boehm at hp.com>
To: "Doug Lea" <dl at cs.oswego.edu>
Cc: "Boehm, Hans" <hans.boehm at hp.com>; "'Andrei Alexandrescu'"
<andrei at metalanguage.com>; "Kevlin Henney" <kevlin at curbralan.com>; "Doug
Lea" <dl at altair.cs.oswego.edu>; "'Ben Hutchings'"
<ben at decadentplace.org.uk>; <pugh at cs.umd.edu>
Sent: Saturday, September 11, 2004 12:52 PM
Subject: RE: Pass 2.3


> On Sat, 11 Sep 2004, Doug Lea wrote:
>>
>> I probably also should have mentioned that on most small embedded
>> systems you can just disable interrupts etc to emulate atomics. (I
>> suppose it is implicit though in that this is also how some of them
>> implement locks.)
> Good point.  However, I think a dual core ARM was announced recently,
> so this may stop working for some "bare metal" embedded applications.
>>
>>
>> > I'm still not sure there are actually important architectures with the
>> > problem you mention below.  It is something to look at, though.
>>
>> I believe the Alpha had this problem. Even if alphas never meet next
>> C++ standard, probably some processor designer will someday decide to
>> also make a chip with word-tearing problems.
>>
> For Alphas, I think this was fixed a long time ago.  I personally think
> that we don't have to accomodate future mistakes in this area.  If someone
> designs a multiprocessor with this sort of issue, they get what they
> deserve.
>
> Hans
>







More information about the cpp-threads mailing list