220 29281 <b06561bd-a1ef-42af-828b-4327d473dcfc@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "'Walt Karas' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Should there be a Standard Library function to throw
 an exception in another thread?
Date: Mon, 31 Oct 2016 11:31:15 -0700 (PDT)
Lines: 75
Approved: news@gmane.org
Message-ID: <b06561bd-a1ef-42af-828b-4327d473dcfc@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1729_543926276.1477938675420"
X-Trace: blaine.gmane.org 1477938696 1426 195.159.176.226 (31 Oct 2016 18:31:36 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 31 Oct 2016 18:31:36 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDFLZXWOVYIBB5E333AAKGQEWX5JXOY@isocpp.org Mon Oct 31 19:31:32 2016
Return-path: <std-proposals+bncBDFLZXWOVYIBB5E333AAKGQEWX5JXOY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f197.google.com ([209.85.217.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDFLZXWOVYIBB5E333AAKGQEWX5JXOY@isocpp.org>)
	id 1c1HMY-0005xQ-5h
	for gclcip-std-proposals@m.gmane.org; Mon, 31 Oct 2016 19:31:14 +0100
Original-Received: by mail-ua0-f197.google.com with SMTP id d33sf121705683uad.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 31 Oct 2016 11:31:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=0o3h7+bczfW/f//B3ugCmhQX3ck0sJ38+9CaL3WoAZo=;
        b=sWfIxFjEXDgbUHxX+HZO//bHwujmOvfNp3QI13/w8KNvF6baq0LuvpoAGSAzZcvUpB
         d27qr/G23zgArxLLsSYAHSQsMW6Dv99nTscB73CB0uoLWmO/CtgBH/Bqr4jL6+YmjFah
         WlXVxDN2QuBzlNzYQP9Zn9ucYiQpzGUAn8XjBz1OGjX+jb3FCFFdaA9iCZ+pW5lvPQkA
         JN49YUSkfWepqExKwBQHfyCu8azxGbERZgecAYu2DS2eOssrYGaRsVGTqmX4Y5n/hSA6
         O9nyHQ+4WHyXn0857OJDDBV/tmtIKzsKFRymP2/eZ4c1egUoMmkJ5qUcH8eF3NUZ6sdD
         eo9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=0o3h7+bczfW/f//B3ugCmhQX3ck0sJ38+9CaL3WoAZo=;
        b=e6aiE9Sm4lP57sxF0pm8Imv6QS1IOkK7oc8dnUsJsH4u0ul6OEI95Ri1b4weMdY0Od
         ECCtZnS4A3Nc+cE76frWQBN64y2OqYMpAPZos7HAQE/5HIRLcHG03huR/kfdVyiFGgI+
         V3pRiU+znLFRH/Qx+6Wp3RE4h9C7u3d6dzXEOV3ooa8acoCg1gOPOAGH5xNvX2svI1XQ
         Q6DAgYIueogF/WDRPu/h5DntEK+tCOFQCLAiK16u4okhLfPjLDcOUsg4igF44bPlPBFH
         fdhKYQIYh/oW4OmV0s5teDpZX8Znj8WLbrxb6qreUM9L5kSOM40OL5vghzbgVuBf1k7g
         wa0g==
X-Gm-Message-State: ABUngvekw3H4+R5sklFwF1rTWYm1Z/kmZW1v7Eva11TtpT263cs0k2piTXuFhQ+cjaCmTg==
X-Received: by 10.159.37.139 with SMTP id 11mr2772460uaf.11.1477938676704;
        Mon, 31 Oct 2016 11:31:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.40.182 with SMTP id s51ls13322465ota.14.gmail; Mon, 31 Oct
 2016 11:31:15 -0700 (PDT)
X-Received: by 10.157.14.231 with SMTP id 94mr2705946otj.9.1477938675844;
        Mon, 31 Oct 2016 11:31:15 -0700 (PDT)
X-Original-Sender: wkaras@yahoo.com
X-Original-From: Walt Karas <wkaras@yahoo.com>
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:29281
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29281>

------=_Part_1729_543926276.1477938675420
Content-Type: multipart/alternative; 
	boundary="----=_Part_1730_1557605048.1477938675420"

------=_Part_1730_1557605048.1477938675420
Content-Type: text/plain; charset=UTF-8

Something like:

template <typename T>
void async_throw(std::thread::id target_thread, const T 
&copyable_object_to_throw);

This doesn't seem like it would be that hard to implement.  One 
implementation would involve the compiler generating a table of two-field 
entries:

( start of instruction pointer address range, pointer to handling code )

The start address of the next entry would be the end of the range for an 
entry.  A binary search using the current instruction pointer of the target 
thread would find the correct table entry, and thus the pointer to the 
handling code.

Implementations could allow this function to be called from signal handling 
routines and interrupt service routines.

Adding this function would probably necessitate a compiler option to ignore 
noexcept specifiers.

-- 
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/b06561bd-a1ef-42af-828b-4327d473dcfc%40isocpp.org.

------=_Part_1730_1557605048.1477938675420
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Something like:<div><br></div><div>template &lt;typename T=
&gt;</div><div>void async_throw(std::thread::id target_thread, const T &amp=
;copyable_object_to_throw);</div><div><br></div><div>This doesn&#39;t seem =
like it would be that hard to implement. =C2=A0One implementation would inv=
olve the compiler generating a table of two-field entries:</div><div><br></=
div><div>( start of instruction pointer address range, pointer to handling =
code )</div><div><br></div><div>The start address of the next entry would b=
e the end of the range for an entry. =C2=A0A binary search using the curren=
t instruction pointer of the target thread would find the correct table ent=
ry, and thus the pointer to the handling code.</div><div><br></div><div>Imp=
lementations could allow this function to be called from signal handling ro=
utines and interrupt service routines.</div><div><br></div><div>Adding this=
 function would probably necessitate a compiler option to ignore noexcept s=
pecifiers.</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/b06561bd-a1ef-42af-828b-4327d473dcfc%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b06561bd-a1ef-42af-828b-4327d473dcfc=
%40isocpp.org</a>.<br />

------=_Part_1730_1557605048.1477938675420--

------=_Part_1729_543926276.1477938675420--

.
