From owner-sc22wg5@open-std.org  Fri Jun 17 23:03:01 2011
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id 036EBC178E6; Fri, 17 Jun 2011 23:03:01 +0200 (CET DST)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from exprod6og101.obsmtp.com (exprod6og101.obsmtp.com [64.18.1.181])
	by www2.open-std.org (Postfix) with ESMTP id DB11BC178DF
	for <sc22wg5@open-std.org>; Fri, 17 Jun 2011 23:02:59 +0200 (CET DST)
Received: from cfexcas02.americas.cray.com ([136.162.34.11]) (using TLSv1) by exprod6ob101.postini.com ([64.18.5.12]) with SMTP
	ID DSNKTfvBAveKBWKMQvXYUlW5vMNvHwddR9hk@postini.com; Fri, 17 Jun 2011 14:03:00 PDT
Received: from fortran.us.cray.com (172.31.19.200) by
 cfexcas02.americas.cray.com (172.30.74.226) with Microsoft SMTP Server (TLS)
 id 8.3.137.0; Fri, 17 Jun 2011 16:02:57 -0500
Message-ID: <4DFBC103.9040703@cray.com>
Date: Fri, 17 Jun 2011 16:02:59 -0500
From: Bill Long <longb@cray.com>
Reply-To: <longb@cray.com>
Organization: Cray Inc.
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version: 1.0
To: sc22wg5 <sc22wg5@open-std.org>
Subject: Re: (j3.2006) (SC22WG5.4481) [ukfortran] Added atomic
References: <20110617160827.0A646C178E6@www2.open-std.org> <20110617205441.D8A9DC178DF@www2.open-std.org>
In-Reply-To: <20110617205441.D8A9DC178DF@www2.open-std.org>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-sc22wg5@open-std.org
Precedence: bulk



On 6/17/11 3:54 PM, N.M. Maclaren wrote:
> On Jun 17 2011, Bill Long wrote:
>>
>> The list of comments on the coarray TR from Rice suggested adding a SWAP
>> atomic subroutine.    The list in 11-200 includes all of the "common"
>> atomic operations except one: atomic andxor. I'm inclined to add that
>> one, which would make SWAP unnecessary. Or we could add both.  For those
>> who are not big amo users...
>>
>> ...
>>
>> If this is added, is there a need for a separate atomic_swap?
>
> Swapping works reliably and portably when one integer may be negative;
> XOR doesn't.

Perhaps even more persuasively, the SWAP routine would be well defined 
for LOGICAL arguments (which we allow for _DEFINE and _REF), whereas the 
andxor version description is problematic for that case.

So, I'm convinced that both versions are useful.

Cheers,
Bill


>
> Regards,
> Nick.
>
> _______________________________________________
> J3 mailing list
> J3@j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3

-- 
Bill Long                                           longb@cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101


