CVS difference for ais/ai-00272.txt

Differences between 1.1 and version 1.2
Log of other versions for file ais/ai-00272.txt

--- ais/ai-00272.txt	2001/09/08 01:42:49	1.1
+++ ais/ai-00272.txt	2002/01/24 04:54:12	1.2
@@ -1,5 +1,6 @@
-!standard  C.06 (07)                                   01-09-05  AI95-00272/00
+!standard  C.06 (07)                                   02-01-23  AI95-00272/01
 !class binding interpretation 01-09-05
+!status work item 02-01-23
 !status received 01-08-21
 !qualifier Error
 !priority Medium
@@ -8,12 +9,14 @@
 
 !summary
 
+A slice of an atomic array type is not (necessarily) an atomic object.
+
 !question
 
-RM95 C.6(7) states that "An atomic object (including a component) is one to
+C.6(7) states that "An atomic object (including a component) is one to
 which a pragma Atomic applies, or a component of an array to which a pragma
 Atomic_Components applies, or any object of an atomic type." "Any object"
-includes a slice (see RM95 3.3(12)).
+includes a slice (see 3.3(12)).
 
 Consider for instance:
 
@@ -29,18 +32,60 @@
 
 !recommendation
 
+(See Wording.)
+
 !wording
 
+Replace the second sentence of C.6(7) by:
+
+An atomic object (including a component) is one to which a pragma Atomic
+applies, or a component of an array to which a pragma Atomic_Components
+applies, or any object of an atomic type, other than objects obtained by
+evaluating a slice.
+
 !discussion
 
+Slices should behave like components for the purposes of atomicity.  That is, a
+component or slice of an atomic thing is not necessarily atomic.
+
+There is one subtlety associated with parameters.  Consider:
+
+   type Arr is array (...) of Component;
+   pragma Atomic (Arr);
+
+   procedure P (X : Arr) is ...
+
+If the first subtype, Arr, is unconstrained, then X may designate a slice at
+execution time. So in order to determine if an object is a slice, an
+implementation may need to do some run-time processing. This is unfortunate,
+but then support of pragma Atomic for unconstrained array is problematic
+anyway.
+
+Note that in the case where Arr is constrained, passing a (non-trivial) slice
+as the actual parameter for X will raise Constraint_Error, so an implementation
+can assume, in the body of P, that it is not dealing with a slice.
+
+Of course, when we say that a slice is not an atomic object, this doesn't mean
+that an implementation cannot read/update it atomically. It only means that
+it doesn't have to.
 
-!corrigendum xx.xx(xx)
+!corrigendum C.6(07)
 
 @drepl
+An @i<atomic> type is one to which a pragma Atomic applies. An @i<atomic>
+object (including a component) is one to which a pragma Atomic applies, or a
+component of an array to which a pragma Atomic_Components applies, or any
+object of an atomic type.
 @dby
+An @i<atomic> type is one to which a pragma Atomic applies. An @i<atomic>
+object (including a component) is one to which a pragma Atomic
+applies, or a component of an array to which a pragma Atomic_Components
+applies, or any object of an atomic type, other than objects obtained by
+evaluating a slice.
 
 !ACATS test
 
+It is unclear whether this can be tested.
 
 !appendix
 

Questions? Ask the ACAA Technical Agent