(j3.2006) (SC22WG5.3729) [ukfortran] Atomic stuff
Jim Xia
jimxia at ca.ibm.com
Wed Dec 3 22:58:40 EST 2008
> Any vendor who allows those as extensions can do whatever they like with
> atomic.
Fair. If there weren't any customers requesting this, we wouldn't have
supported it either. Actually I wasn't worried about sequence statement
because I think anyone applying atomic operations on storage associated
entities is clearly out of his mind.
What I'm really concerned about are structure components. For a sequence
derived type, we don't do any padding and it becomes equivalent to a C
struct in pack mode. So its elements can easily be out of natural
alignments. I would expect this could be a fairly common implementation
on sequence types (or a user defined type rather than an intrinsic type)
way back before Fortran 90 came around. Another potential problem is a
derived type with BIND attribute. If the companion C processor requires
structures to be in packed mode, then the derived type in Fortran side
will also be without any alignment. That too will cause trouble for
atomic operations.
It seems to me that we can fix this by putting a sentence in the
description of argument ATOM in ATOMIC_DEFINE and ATOMIC_REF that it can
not be a subobject of sequence type or a derived type with BIND attribute.
Cheers,
Jim Xia
RL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444 Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20081203/200a8bd1/attachment.html
More information about the J3
mailing list