comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <PChapin@vtc.vsc.edu>
Subject: Re: About task-safeness
Date: Wed, 2 Feb 2011 17:40:46 -0500
Date: 2011-02-02T17:40:46-05:00	[thread overview]
Message-ID: <alpine.WNT.2.00.1102021733070.5716@WHIRLWIND> (raw)
In-Reply-To: <b78da113-7666-4a73-9a87-03f6ec69bdb5@d28g2000yqc.googlegroups.com>

On Wed, 2 Feb 2011, Shark8 wrote:

>> two tasks "only reading" values from the same container are *not* safe .
>
> Interesting! That is counter-intuitive; do you have a link to an 
> example/explaination?

Actually, in the absence of documentation to the contrary, I wouldn't expect 
simultaneous reads to be safe. Some data structures get modified internally 
in response to reads. For example splay trees[1] bring the last read item to 
the root. Thus looking up an item in a splay tree entails various 
transformations on the tree that would have to be reviewed for task safety 
(or otherwise protected).

By not guaranteeing task safety during simultaneous reads, the Ada reference 
manual is allowing implementors to keep their options open. That seems fair 
to me.

Peter

[1] http://en.wikipedia.org/wiki/Splay_tree



  reply	other threads:[~2011-02-02 22:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 20:51 About task-safeness mockturtle
2011-02-02 21:01 ` Vinzent Hoefler
2011-02-02 21:14   ` mockturtle
2011-02-02 22:16     ` Maciej Sobczak
2011-02-02 22:28       ` Shark8
2011-02-02 22:40         ` Peter C. Chapin [this message]
2011-02-03  8:33           ` Dmitry A. Kazakov
2011-02-03 17:59       ` Vinzent Hoefler
2011-02-02 22:38 ` J-P. Rosen
2011-02-03  2:44 ` Randy Brukardt
2011-02-03  8:53   ` Niklas Holsti
2011-02-03 11:07     ` Georg Bauhaus
2011-02-03 11:22       ` AdaMagica
2011-02-03 18:13         ` Jeffrey Carter
2011-02-04  0:33     ` Randy Brukardt
replies disabled

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