220 38130 <2300193.1RphyUdPvq@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: memcpy/memset/etc overloads for volatile memory
Date: Fri, 18 May 2018 17:16:39 -0700
Lines: 29
Approved: news@gmane.org
Message-ID: <2300193.1RphyUdPvq@tjmaciei-mobl1>
References: <CAFdMc-0NAvWrkwzpgEKq4DQj=0vL_0F2s17XyR9MSUNJk5R0sw@mail.gmail.com> <CAFdMc-3V0VJ9nOs2fg4OuRr4N8TG-VXsrek1v=CJpr=Bqt98+Q@mail.gmail.com> <dc37b3f7-74b8-b94f-0a1c-59bb99ecbccc@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1526688882 5908 195.159.176.226 (19 May 2018 00:14:42 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 19 May 2018 00:14:42 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRB26Z7XLQKGQEOFKNMHY@isocpp.org Sat May 19 02:14:38 2018
Return-path: <std-proposals+bncBCB4TK757YBRB26Z7XLQKGQEOFKNMHY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f198.google.com ([209.85.220.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRB26Z7XLQKGQEOFKNMHY@isocpp.org>)
	id 1fJpWA-0001M1-4p
	for gclcip-std-proposals@m.gmane.org; Sat, 19 May 2018 02:14:38 +0200
Original-Received: by mail-qk0-f198.google.com with SMTP id l7-v6sf3584329qkk.20
        for <gclcip-std-proposals@m.gmane.org>; Fri, 18 May 2018 17:16:44 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1526689004; cv=pass;
        d=google.com; s=arc-20160816;
        b=gbtvqNbvs51ln75l4K4Bk3agrlc+Of71zlKIDxfgRzC6Ij09ZamqH6Jxgx0x1XPHk7
         dOqhg4S6MG7TcwGKepBp33M6tzU1ss/q3VsBPEl/JnQu5ZqnAJmiaRkZTOW4YE9ZjZ8V
         par7AGaRlgClPP40TL3PDaamjHZwNhqMCF9wqM1N8FXhxCehbfp3WL4yU3BMHZjL3d+X
         U8LUdGkA5dBZ9HE5HqyQsOxZUpjM8sikJiavjAmZGGM9IMnkdBFgzmS1UrTvRkZgNa8C
         hKAqIsnuLTLjUE5PR/uYKTtDbpf7AnncyQ+9Tvo8pAtxSJMWs47VZUNcXfW9Gj6OhT/R
         MS7w==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=6yXL6xFsBrdAuEFmg7JRsXGKOBFwOV9ruCX+lGLzAYw=;
        b=DPD1LOqRLcROIpthqSUT1IjGjS/IWy4/o6xwX1u28zFaC2wpIjok0T30qjsBx9wxhS
         Q1gHZLiwwB6slu85mC+U5+9BRw/qA6olNSPuYquydNyBC5exupItSBsq8Vu+Se8Hv87F
         kM7A5/9PFRNbmPHWsrGq33akrQIAb2hr2UuXMslVl305lfkK1LKVfX7Homg+jnB3PhAs
         0YE4tw+tZKponBHsbieY0nVqF3kxvW7mCPqETWrWKhnBxvKOWZB0RSLNy5Nk08ySCTDR
         9FnSKLf6f5hWks24D3q1wGVCxBcydsklCzsP72/HZ7EjMVdJM3+tyGrTuN/3tYNLegjo
         ll3A==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 209.222.10.136 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=6yXL6xFsBrdAuEFmg7JRsXGKOBFwOV9ruCX+lGLzAYw=;
        b=JuKuk/tD5uXeGHrhBILZwNaomwjllDemX6PV/7RV0Tk8lYCUQ8yIPrdMh/7TYzRyvU
         Ro9J7CbTGprqnyOvvzt/NbzEbIT2pxSNOiniKJWgYaZD+z+DVK3NqOplim+Tex9kmW1F
         BGNE+fwWq0ztCRcfg27WrBdSBMJRbmzgxajmTl4/BoRJ8NwDIQ7hMh8z1q7Kr5D2p2fR
         0+KWjV7hsp2O5qpLCieZSYCx88niIwxZ1B35D8Ro8u9ARXulPnonMXnXqQ0nGuCytaaj
         KWi9JIyGIc1UD1dKpLFnqocoR7ydi0PfawAPMkBjwIaiepFPr3ZlyR00SfUiLN02krIX
         1eWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=6yXL6xFsBrdAuEFmg7JRsXGKOBFwOV9ruCX+lGLzAYw=;
        b=sJe5uPxBPPHLMN9Zim9adOEk0eDUf9tn9cVsqsfm97498TdnHyjR9swMR6V/fCfqQo
         x94wLbKNDJJLt658YOB8GkmawskyfYkpHfphIivImbRT8YcGXQfzOyb7u2ANLXdSxZs5
         MXh3ku5iPpVRXXACQDUFKkLVlV98WOc1g5oZWi+C7UF/4KVb58uXIZjKehsMoFo+lEBE
         0ABPT4Eoyu8mcn315LDnvllIpZqUaD8OLw33iFqH0Wm5JlLCpvXV9wXjuUdUHHYp3JaB
         SnB5UvLb8ZbGLgD8Crf6AqXnfQbvWr/4RyP17lDn5akJ8Sh1VsJSVKYoiwOI/1IPPpFU
         grZw==
X-Gm-Message-State: ALKqPwdnfsT2IkBbfMdezucOL3rQeRrKzSJ3rBwFbgDLwWD6d6gmgVkH
	MvrT8/4cIZmG8Em+WSJFdu+cjg==
X-Google-Smtp-Source: AB8JxZo0ntl8/sYs3ITWvOjQ3Ml07CBHyuWNLIfqhuBsj1GuZXxxeAXVUa+vHJpajiekA/A1I/do7A==
X-Received: by 2002:a37:4dce:: with SMTP id a197-v6mr7624446qkb.59.1526689003966;
        Fri, 18 May 2018 17:16:43 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:ac8:4417:: with SMTP id j23-v6ls4698272qtn.13.gmail; Fri, 18
 May 2018 17:16:43 -0700 (PDT)
X-Received: by 2002:aed:2785:: with SMTP id a5-v6mr11233648qtd.249.1526689002993;
        Fri, 18 May 2018 17:16:42 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1526689002; cv=none;
        d=google.com; s=arc-20160816;
        b=YRyN17rJYnE2ixQAKASgk/+HBAGAHRi5PUdwmUVxvm8f6mrFbbRER0PiYX40wGBbH1
         7p2cup6DAae7tV1uq7ha9VXEJajv0E5fPJttiIPxxtxA3ckwVBX8gQHH7Af8i0TbFmyP
         S1sudWiAzlOd7OlhV382PE/pM4Lf9aWE8SaWINBuMXF12F6KuxXeLyT4rwrOFuoka5Ne
         I6RtoAOv0qjDGuW3sT3Wi1XauCbDx+GGcbZXP3s5nc9iCezEje/rW7mwDFNeyn8AgaLj
         cT2kJQZQrLWrF5yqDx+KFV2JVFpH3TlitbzCrV4ikfCKZm/evlwfxxWSwJnwy53v2w4C
         1XoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=MPQ1HQnMc970iWm7NMgWq5bhftrDXaEbpeZv0aXKRBk=;
        b=FXDcuGg1r6S4vVqJuqOEwvWg9AoKJRcdW5PhzoXwcdSOHAr/PF9ToIZkuVs3nHMiGg
         LbUT43r+uXnL48oxPGU7eAyKI/949WOJB8M5Cv/X9B4cWqyTbSpvxxIB7XJO00hBtrZv
         EKCfWfb9T9J8oneHxvd5RibvRRWyc78mM/ZQxIL/aC4r3U34TNq/lHHwRj9DltoNC901
         Ph7E8dkbt63MGNEJn9lEzuznr10sXePDfJ3nimWrAyR0SlO/uue0W6TmatmpGUmdSl/c
         PKLsCXXOp07gfTA4CSi/hiIKMCk7IjdA1Zs/jLpCrhRHTpcDRXRY2qat/Epn+Tq7sWQu
         B0mw==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 209.222.10.136 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from smtp.macieira.info (arvernien.macieira.info. [209.222.10.136])
        by mx.google.com with ESMTPS id p12-v6si3194584qvl.241.2018.05.18.17.16.42
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 18 May 2018 17:16:42 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 209.222.10.136 as permitted sender) client-ip=209.222.10.136;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:bc1f:402:4b5e:fda5])
	by smtp.macieira.info (Postfix) with ESMTPSA id 85B13E7B4
	for <std-proposals@isocpp.org>; Fri, 18 May 2018 17:16:40 -0700 (PDT)
In-Reply-To: <dc37b3f7-74b8-b94f-0a1c-59bb99ecbccc@gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 209.222.10.136 as permitted sender) smtp.mailfrom=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:38130
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38130>

On Friday, 18 May 2018 14:13:15 PDT Andrey Semashev wrote:
> What is "the right thing"? Does it have to be a byte-granular operation?
> Does it have to be a forward iteration? Is this behavior the same on all
> implementations? You have to answer on all these questions in the
> standard wording so that everyone can rely on the exact memory access
> pattern, which is important in case of volatile memory.
> 
> If it is not important in your case then you don't need volatile and
> hence the overload.

On the other hand, if your memory storage requires a specific behaviour which 
cannot be standardised, maybe you should implement the copying directly in 
your code. It's not like bytewise memcpy and memset are particularly difficult 
to implement...

It's the SIMD-optimised with cacheline-alignment and such that are.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2300193.1RphyUdPvq%40tjmaciei-mobl1.

.
