Topic: Should there be a Standard Library function to throw


Author: "'Walt Karas' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 31 Oct 2016 11:31:15 -0700 (PDT)
Raw View
------=_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--

.