comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: Concurrent access to packed arrays
Date: 27 Jan 2001 17:37:29 +0100
Date: 2001-01-27T17:37:29+01:00	[thread overview]
Message-ID: <873de5dk8m.fsf@deneb.enyo.de> (raw)
In-Reply-To: 3A71447B.A2082CA3@mac.com

Mats Weber <matsw@mac.com> writes:

> Yes, I think there are. When task B writes the data, it will do
> something like
> 
>    The_String(Last_Written + 1) := ...
>    Last_Written := Last_Written + 1;
> 
> on modern architectures, the memory accesses can get reordered, i.e.
> Last_Written can get updated before The_String and reading tasks will
> read uninitialized data.

Very good point.  Thanks.  (Not every architecture has complex cache
coherency protocols like Intel's. ;-)

So I'm going to add an interface which uses a protected type.
(There's no need to use it by default because most of the time, no
concurrent access occurs.)



  parent reply	other threads:[~2001-01-27 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-21 10:59 Concurrent access to packed arrays Florian Weimer
2001-01-21 16:00 ` Robert Dewar
     [not found] ` <3A71447B.A2082CA3@mac.com>
2001-01-27 16:37   ` Florian Weimer [this message]
2001-01-27 23:06     ` Mats Weber
2001-01-27 23:56       ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox