220 39325 <CAC+0CCP_jeR=fr7a+XVeVJ+0wm4KG9U6iEunOHk3y2qSi3jrjg@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Jake Arkinstall <jake.arkinstall@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Alternative proposal for mapping P0709
 Deterministic Exceptions into C
Date: Tue, 24 Jul 2018 02:54:59 +0100
Lines: 72
Approved: news@gmane.org
Message-ID: <CAC+0CCP_jeR=fr7a+XVeVJ+0wm4KG9U6iEunOHk3y2qSi3jrjg@mail.gmail.com>
References: <6a65c934-5d2a-4e75-b88d-9eaaee338bd3@isocpp.org> <1c229827-6d5d-45bd-8766-c3af818b2b0b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="0000000000004130860571b50d36"
X-Trace: blaine.gmane.org 1532397184 1796 195.159.176.226 (24 Jul 2018 01:53:04 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 24 Jul 2018 01:53:04 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDCZX3WUUQFRB7MN3LNAKGQEE5EMIBY@isocpp.org Tue Jul 24 03:53:00 2018
Return-path: <std-proposals+bncBDCZX3WUUQFRB7MN3LNAKGQEE5EMIBY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f199.google.com ([209.85.223.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDCZX3WUUQFRB7MN3LNAKGQEE5EMIBY@isocpp.org>)
	id 1fhmVY-0000LN-DK
	for gclcip-std-proposals@m.gmane.org; Tue, 24 Jul 2018 03:53:00 +0200
Original-Received: by mail-io0-f199.google.com with SMTP id w23-v6sf1648326iob.18
        for <gclcip-std-proposals@m.gmane.org>; Mon, 23 Jul 2018 18:55:11 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1532397310; cv=pass;
        d=google.com; s=arc-20160816;
        b=BIRj23On/orhLuCCDJjrHmjY4bDL1ovpM/iZRvaXzu7AFSa9jkLPuBJopX3jqRJL3o
         VjiPXsR1CDrkBjk3I9SSILIOK/NqNPxsq4J2jx8ZQJzX8hWLhCQqDy1eFhimMEXTytJJ
         EePnYGyEs3/P5r3AS2MmJyT6nd3hjeJ/i+VA486k7ACJPCKPcs6h8cQci5PIu5ff/QrO
         VzvLgtX6KQPu/s7XgmvUXUKGP6IYTpx24o8ir+/zycvgyTqSmfrrPY23Bg+iBDW4O9JK
         uqXRcSue5udKKI7Z+nzI/yO2V8CLxFweVKoViUoC3jzHPryFRWfZwghz73F3YuCxcm0N
         SVag==
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:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=ttDFWPdeIlmyeCTA2LvwcS3rL5zN07fDQvkowmeiOwo=;
        b=W7l0MN2+I7IeC676pm6OLNuxZ/RQme1wwI9fVekIBydJ42pXemp7bc7rwoJdxYLpoF
         7wIcgNeZXV0qejxL6TkqiQmgSbRbPCGVE0tdGUpq92cNjuSKzUK7sn1Unm4X31a6LPml
         OqF3IxN3XA4Uyq2Np5GY9Y5/sMyiQFterWy9DVN7ok+vtNb8fWKCeaUgD6nEUAReGMqo
         wru7k5JBk/b4mQAAuuQxQCbrIHCGdIz4SXCTDd/ts1qH08S+v8BvhM0phbPCZhE50utV
         jsYRwr/R4/oFSO4YASSCVeGTf5ahpBXjwmBIVrOvR5OpO3A0VxsZLa0/lL2roGzAOrW+
         3l0w==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=JgohdTEM;
       spf=pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :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=ttDFWPdeIlmyeCTA2LvwcS3rL5zN07fDQvkowmeiOwo=;
        b=fyJWc+8a/bn+ou7dD0UcIYsrEgf11o93nnoRDKHehWDjsQdG37QpdO7zV25C67O3au
         gCApIHkromVjZy26Ymrudak0+OosU1LU5t48iKL9QAXJs6wDCGe8fxRhHcKyQKFvpsQg
         IXd/oEdNTMKCwmUSIQ56tKeLA7WDnD50E3fH291JdQ4/4fn+k4mwvlT6Jr5CGOcDI47Z
         TZNFi8NMWC+Xn6BSNNy2/fBoUyh6V7SzPaTtPB4t8wkKlsm5h909iT7n2eHlfJAnyaEl
         o8DuSutIEIU1dOZz+NIvBkgaKQZf1YAKB5AJPMQQx5M15eiCGAZdMUCaFW9p96PMG+mj
         Z2HQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to: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=ttDFWPdeIlmyeCTA2LvwcS3rL5zN07fDQvkowmeiOwo=;
        b=YsVuNTi31bfQ7KuyhcHpVvox0JTrtz6/7nFXZ0NAcdsLBcOlWu8aFcULvB3jANKQQc
         40CKlN5ivqmKpe+H6XIxofYa7RqIm5mGqnxnXY6WUaN3d5nxFzHJVfsml4vdqLhddGFt
         4Hm3fgpLVZS23u4JqpAxdUVgiVxtBIvUWF67uMeZQASd+zJkC9XGQRVVQCT0UzXHwa6k
         PjN0XNh0J5ZBEuYrLxpS7nXTyC9kqdphrJ2AHucVcW+o3WQ4BpMlCbYb9/T7ZWJ8BgTw
         GwkKwf4PmNq68TLjTXm+9WdsfEBsB06cT+L6vY2t6LUS9px844RmiN7gGDxBuZM22Fm3
         0EAA==
X-Gm-Message-State: AOUpUlHEuNRSTxOFsvwb7cdb3twVBmhbMiTbIyRW5XgF9xtEoMGT7RP4
	INpXMiUJIFv+KK4JR/P3Y3CMIw==
X-Google-Smtp-Source: AAOMgpfZuUuZHtg4iV7JMBKrUDU8xvbU79rAkzHUC9kR+Gues9gfbhcH4a9tsS1RwkcE21OVhtdTpw==
X-Received: by 2002:a6b:2306:: with SMTP id j6-v6mr5971399ioj.51.1532397310814;
        Mon, 23 Jul 2018 18:55:10 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a5e:881a:: with SMTP id l26-v6ls1368738ioj.0.gmail; Mon, 23
 Jul 2018 18:55:09 -0700 (PDT)
X-Received: by 2002:a6b:9711:: with SMTP id z17-v6mr11591662iod.205.1532397309482;
        Mon, 23 Jul 2018 18:55:09 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1532397309; cv=none;
        d=google.com; s=arc-20160816;
        b=f+hCCXv+uiuY8rwAYbXN6ctGOktz290GyCnnJtYzddfl3EZnJDGZ6WwurOmfymf95a
         hvbqEaLETDpXpO89bO/t3XWwRfvME9XNbrxW2MEvqkygIzEaGySnDJlRyI3kwMwVCq+G
         G8J0tcPe+sLXauxmfpzfq/8wLmpO2NmDezKVNR2H5ljIkd5VhrhJrlALArT5z5mI9THD
         sDaqxYU4UBeWmdSTEmhoO43iILYMME+D0AfRMgGkOSxrdYTivaqDgge2sjRHA3nOEQ2S
         4uSH7FZ4LkFAQumqpro+3b8JGngohu6jwxtMQi5qznvDU1Qq2Y+/EruOPIzPkyRicorX
         bkuQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature:arc-authentication-results;
        bh=qV2spr105O/wlEjWZoCbXu6hRwlx0aw2SgbDngIu+Qo=;
        b=fHGtGUF4LgQ45ACGqKWLGjwystpqNfwP8BQKXugH7KR4VNVNZSQ0EAVDD9SgsDk8m0
         6uPA0prar/0jq7xszD20UZOD77TV1UrpZleDpWkbASFdG+x8tHD5hSOfONc14Y/Fz0PF
         bObg01m2WEQrXN4JPkX9+oo9kqCVIxo60DXeLjszbYrZDZqZkP6bljY4iGdQ0VBM5orS
         m8QNy+sRjmb63jGOj0dR8C0mf0C3XwC5ZhWYhAgksGNiyuvz5bYEgJoyjeqNF0Yk4fOF
         ZYq28pbbzIT/Vb1yJdO+8q0QCvStT4TXicnQiNAZ6velgJjzrY9J/tjuP0cvuQeGwrC4
         5WcA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=JgohdTEM;
       spf=pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id d1-v6sor166090itf.5.2018.07.23.18.55.09
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Mon, 23 Jul 2018 18:55:09 -0700 (PDT)
Received-SPF: pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a24:2206:: with SMTP id o6-v6mr1151167ito.112.1532397308946;
 Mon, 23 Jul 2018 18:55:08 -0700 (PDT)
In-Reply-To: <1c229827-6d5d-45bd-8766-c3af818b2b0b@isocpp.org>
X-Original-Sender: jake.arkinstall@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=JgohdTEM;       spf=pass
 (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
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:39325
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39325>

--0000000000004130860571b50d36
Content-Type: text/plain; charset="UTF-8"

Error handling via an effective static state isn't thread safe. Marking the
flag as volatile and telling users to check for errors immediately after
the function call goes some way to help, I guess, but it's not sufficient
to guarantee that errors won't crop up in the wrong thread (or do I have
some reading to do?)

This issue is conceded in the paper, albeit referenced as "complicated
function calls", but later they state that the C standard library should
make this ubiquitous.

It follows that any code using this approach in future (and any code that
calls that code, and so on) is not thread safe. Any error which occurs in
one thread could pop up as an error in a different thread - and depending
how deep that error handling code is in a library, this could have a
devastating impact.

An option is to have the error structs as an array indexed by
thrd_current(). This means dynamic allocation and the introduction of
helper functions rather than the nice direct struct member access, and thus
it is unlikely to gain much traction.

-- 
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/CAC%2B0CCP_jeR%3Dfr7a%2BXVeVJ%2B0wm4KG9U6iEunOHk3y2qSi3jrjg%40mail.gmail.com.

--0000000000004130860571b50d36
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr">Error ha=
ndling via an effective static state isn&#39;t thread safe. Marking the fla=
g as volatile and telling users to check for errors immediately after the f=
unction call goes some way to help, I guess, but it&#39;s not sufficient to=
 guarantee that errors won&#39;t crop up in the wrong thread (or do I have =
some reading to do?)</div></div></div><div dir=3D"auto"><br></div><div dir=
=3D"auto">This issue is conceded in the paper,=C2=A0albeit referenced as &q=
uot;complicated function calls&quot;, but later they state that the C stand=
ard library should make this ubiquitous.</div><div dir=3D"auto"><br></div><=
div dir=3D"auto">It follows that any code using this approach in future (an=
d any code that calls that code, and so on) is not thread safe. Any error w=
hich occurs in one thread could pop up as an error in a different thread - =
and depending how deep that error handling code is in a library, this could=
 have a devastating impact.</div><div dir=3D"auto"><br></div><div dir=3D"au=
to">An option is to have the error structs as an array indexed by thrd_curr=
ent(). This means dynamic allocation and the introduction of helper functio=
ns rather than the nice direct struct member access, and thus it is unlikel=
y to gain much traction.</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCP_jeR%3Dfr7a%2BXVeVJ%2B0wm4K=
G9U6iEunOHk3y2qSi3jrjg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoo=
ter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CC=
P_jeR%3Dfr7a%2BXVeVJ%2B0wm4KG9U6iEunOHk3y2qSi3jrjg%40mail.gmail.com</a>.<br=
 />

--0000000000004130860571b50d36--

.
