220 31237 <CA+wfc19hFNcyjVn=oiFn+rf=zUYYyxjmZ-Zp-wDiK2n61DqeaA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Oliver Kowalke <oliver.kowalke@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: P0534: call/cc, type safety and exceptions
Date: Wed, 1 Mar 2017 11:59:02 +0100
Lines: 158
Approved: news@gmane.org
Message-ID: <CA+wfc19hFNcyjVn=oiFn+rf=zUYYyxjmZ-Zp-wDiK2n61DqeaA@mail.gmail.com>
References: <fc546ea4-a355-4a60-a7e7-97927993471d@isocpp.org>
 <3a57e294-7254-4358-828d-c9f7757f5295@isocpp.org> <9deccbda-26ca-4ad8-a579-1feb674676a6@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c03ed8835fdd0549a9344e
X-Trace: blaine.gmane.org 1488365964 1920 195.159.176.226 (1 Mar 2017 10:59:24 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 1 Mar 2017 10:59:24 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCLZHP5J7MHRBC6T3LCQKGQE7OGWEIY@isocpp.org Wed Mar 01 11:59:19 2017
Return-path: <std-proposals+bncBCLZHP5J7MHRBC6T3LCQKGQE7OGWEIY@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+bncBCLZHP5J7MHRBC6T3LCQKGQE7OGWEIY@isocpp.org>)
	id 1cj1yY-0008VA-Fg
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Mar 2017 11:59:18 +0100
Original-Received: by mail-qk0-f198.google.com with SMTP id u188sf55040446qkc.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Mar 2017 02:59:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references: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=8cqCQZQOckfnckhZNZX7lnG40TvZ42uJf7szi7S8qX4=;
        b=B4IpAyyYoP3GHXzsK7/I03GIcFdQBlrC8S4c1utlz9vjwfWQQzw8gRGMO07EmW2M3b
         dx/QbNrHRthTaKg/CGejhcn7xAJLZppIt56yVghNE7g0D/Rz1b+xUmoeZ9wnr4CvAOGK
         m5PPaRp0R+9llCgjbSNORkFF8Of3yTJQVjwr6N9qgeocmP+v9Zhw43gLZQjzIg/4SUSa
         55r1gHuo876CDSzZR5IVZWBsjSKj32lTOLlzwhcuvcAeoLmP7hVSLiYnx5Gt4onHJ/kS
         m/HMi/l9mVY+y6LFJZ4aOtDFhNyPMFPNbvAZ0iYnEco5gOjpyEpCIx3q/TP83Ebk5jI8
         FVCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references: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=8cqCQZQOckfnckhZNZX7lnG40TvZ42uJf7szi7S8qX4=;
        b=ujhfSwhWuV0MSjM3JdMVJ5HoxIlPdDVsQMouwVBWulkKI/RjBh6Gahdcs69dnqGDyc
         2ZN3EXPBlPVc64je/XMptNTu0vmrDiR16WtizxsQzajgW617f3l/Tiw2bjGR8VDTUCoY
         2VhpS+PixrP+rJBc4nNzGHhNtMHs7jl7fb27eZxJiwcJcH9YgdNI28Qcj9Dqn7zYSz8Y
         wtMJYXLVgOcZFNitI/pNeyTduAWO6mOfdG9qS0PyyonGTvC8o18kvkBMzm/eMQcBOLaL
         EokK6RPtOrLASiNQwxrbadzz0mY9TR4QifqefC9iEC+YOnKVEkEiyMINv33HTHegv/lA
         K5pw==
X-Gm-Message-State: AMke39luqvwQ2LJpYfJVDqYuwGgDmFfZc7zbBRZYzL6aOlc6V+hy/IblK2Xr2ibUNIpH2g==
X-Received: by 10.237.60.99 with SMTP id u32mr2217730qte.24.1488365964355;
        Wed, 01 Mar 2017 02:59:24 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.7.195 with SMTP id 61ls3580969oto.31.gmail; Wed, 01 Mar
 2017 02:59:23 -0800 (PST)
X-Received: by 10.129.4.68 with SMTP id 65mr2807958ywe.333.1488365963382;
        Wed, 01 Mar 2017 02:59:23 -0800 (PST)
Original-Received: from mail-yw0-x22d.google.com (mail-yw0-x22d.google.com. [2607:f8b0:4002:c05::22d])
        by mx.google.com with ESMTPS id v15si497801ywv.13.2017.03.01.02.59.23
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 01 Mar 2017 02:59:23 -0800 (PST)
Received-SPF: pass (google.com: domain of oliver.kowalke@gmail.com designates 2607:f8b0:4002:c05::22d as permitted sender) client-ip=2607:f8b0:4002:c05::22d;
Original-Received: by mail-yw0-x22d.google.com with SMTP id d1so28517080ywd.2
        for <std-proposals@isocpp.org>; Wed, 01 Mar 2017 02:59:23 -0800 (PST)
X-Received: by 10.37.11.146 with SMTP id 140mr2767816ybl.35.1488365962876;
 Wed, 01 Mar 2017 02:59:22 -0800 (PST)
Original-Received: by 10.129.173.21 with HTTP; Wed, 1 Mar 2017 02:59:02 -0800 (PST)
In-Reply-To: <9deccbda-26ca-4ad8-a579-1feb674676a6@isocpp.org>
X-Original-Sender: oliver.kowalke@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 oliver.kowalke@gmail.com designates 2607:f8b0:4002:c05::22d as permitted
 sender) smtp.mailfrom=oliver.kowalke@gmail.com;       dmarc=pass (p=NONE
 sp=NONE 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-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:31237
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31237>

--001a11c03ed8835fdd0549a9344e
Content-Type: text/plain; charset=UTF-8

2017-03-01 11:39 GMT+01:00 <ogee@agnicore.com>:

> 2) P0534 is intended to be as low level as possible while still being
>> functional. By specializing types, it would be higher level than strictly
>> *necessary*.
>>
>
> low level API it's fcontext_t and several functions to context switching,
> continuation it's high level wrapper
>

that's wrong


> On Wednesday, March 1, 2017 at 10:26:57 AM UTC+3, Oliver Kowalke wrote:
>>
>> For instance during the implementation of my coroutine and fiber
>> libraries I encountered that initialization- and termination-phases were
>> required. In those phases no data at all or data of different types are
>> transferred.
>> Imagine the type of the transferred data does not have an default-ctor -
>> you have to pass an value each time the continuation is resumed. What if
>> you can't produce one or you want to terminate the continuation.
>> Of course you could use something like variant or optional, but you would
>> pay each time for the overhead even in cases were you don't need
>> variant/optional etc.
>>
> also you can use custom type for wrap it and reduce overhead, or hide
> internals from use
>

you still pay for thinks you don't need


The switch mechanism proposed in P0534 is symmetric, e.g you have to
>> explicitly specify the continuation that has to resumed next.
>> To which continuation do you want to jump to in context_exit?
>>
> If I get you right `context_exit` executed ontop of caller context
> because in `context_entry` we have:
> ontop_fcontext( t.fctx, rec, context_exit< Rec >);
> and if we catch exception in continuation, we can rethrow it to caller
> context in context_exit
> or I don't understand some use cases?
>

if you throw an exception in the middle of your continuation and it it
escapes the top-level continuation you have no guaranttee that the calling
continuation is still valid (might resumed and termianted already)

-- 
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/CA%2Bwfc19hFNcyjVn%3DoiFn%2Brf%3DzUYYyxjmZ-Zp-wDiK2n61DqeaA%40mail.gmail.com.

--001a11c03ed8835fdd0549a9344e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">2017=
-03-01 11:39 GMT+01:00  <span dir=3D"ltr">&lt;<a target=3D"_blank" href=3D"=
mailto:ogee@agnicore.com">ogee@agnicore.com</a>&gt;</span>:<br><blockquote =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex" class=3D"gmail_quote"><div dir=3D"ltr"><span class=3D"gmail=
-"></span><span class=3D"gmail-"><blockquote style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class=3D"gmail=
_quote"><div dir=3D"ltr"><div>2) P0534 is intended to be as low level as po=
ssible while still being functional. By specializing types, it would be hig=
her level than strictly <i>necessary</i>.</div></div></blockquote></span><b=
r><span class=3D"gmail-"></span><div>low level API it&#39;s fcontext_t and =
several functions to context switching, continuation it&#39;s high level wr=
apper<br></div></div></blockquote><div><br></div><div>that&#39;s wrong<br><=
/div><div>=C2=A0</div><blockquote style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex" class=3D"gmail_quote"><di=
v dir=3D"ltr"><span class=3D"gmail-"></span><div><span class=3D"gmail-">On =
Wednesday, March 1, 2017 at 10:26:57 AM UTC+3, Oliver Kowalke wrote:<blockq=
uote style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex" class=3D"gmail_quote"><div dir=3D"ltr"><div><div class=
=3D"gmail_quote">For instance during the implementation of my <span>corouti=
ne</span>
 and fiber libraries I encountered that initialization- and=20
termination-phases were required. In those phases no data at all or data
 of different types are transferred.<br><div>Imagine the type of the transf=
erred data does not have an default-<span>ctor</span>
 - you have to pass an value each time the continuation is resumed. What
 if you can&#39;t produce one or you want to terminate the continuation.</d=
iv><div>Of
 course you could use something like variant or optional, but you would=20
pay each time for the overhead even in cases were you don&#39;t need=20
variant/optional etc.</div></div></div></div></blockquote></span><div>also =
you can use custom type for wrap it and reduce overhead, or hide internals =
from use<br></div></div></div></blockquote><div><br></div><div>you still pa=
y for thinks you don&#39;t need <br></div><div><br><br></div><blockquote st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex" class=3D"gmail_quote"><div dir=3D"ltr"><div><span class=3D"gm=
ail-"><blockquote style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r=
gb(204,204,204);padding-left:1ex" class=3D"gmail_quote"><div dir=3D"ltr"><d=
iv><div class=3D"gmail_quote"><div>The
 switch mechanism proposed in P0534 is symmetric, e.g you have to=20
explicitly specify the continuation that has to resumed next.<br></div><div=
>To which continuation do you want to jump to in context_exit?<br></div></d=
iv></div></div></blockquote></span><div><span class=3D"gmail-m_611834693342=
1255512short_text" id=3D"gmail-m_6118346933421255512result_box" lang=3D"en"=
><span>If I get you right</span></span> `context_exit` executed ontop of ca=
ller context because in `context_entry` we have:<br><div class=3D"gmail-m_6=
118346933421255512prettyprint" style=3D"background-color:rgb(250,250,250);b=
order-color:rgb(187,187,187);border-style:solid;border-width:1px"><code cla=
ss=3D"gmail-m_6118346933421255512prettyprint"><div class=3D"gmail-m_6118346=
933421255512subprettyprint"><span class=3D"gmail-m_6118346933421255512style=
d-by-prettify" style=3D"color:rgb(0,0,0)">ontop_fcontext</span><span class=
=3D"gmail-m_6118346933421255512styled-by-prettify" style=3D"color:rgb(102,1=
02,0)">(</span><span class=3D"gmail-m_6118346933421255512styled-by-prettify=
" style=3D"color:rgb(0,0,0)"> t</span><span class=3D"gmail-m_61183469334212=
55512styled-by-prettify" style=3D"color:rgb(102,102,0)">.</span><span class=
=3D"gmail-m_6118346933421255512styled-by-prettify" style=3D"color:rgb(0,0,0=
)">fctx</span><span class=3D"gmail-m_6118346933421255512styled-by-prettify"=
 style=3D"color:rgb(102,102,0)">,</span><span class=3D"gmail-m_611834693342=
1255512styled-by-prettify" style=3D"color:rgb(0,0,0)"> rec</span><span clas=
s=3D"gmail-m_6118346933421255512styled-by-prettify" style=3D"color:rgb(102,=
102,0)">,</span><span class=3D"gmail-m_6118346933421255512styled-by-prettif=
y" style=3D"color:rgb(0,0,0)"> context_exit</span><span class=3D"gmail-m_61=
18346933421255512styled-by-prettify" style=3D"color:rgb(102,102,0)">&lt;</s=
pan><span class=3D"gmail-m_6118346933421255512styled-by-prettify" style=3D"=
color:rgb(0,0,0)"> </span><span class=3D"gmail-m_6118346933421255512styled-=
by-prettify" style=3D"color:rgb(102,0,102)">Rec</span><span class=3D"gmail-=
m_6118346933421255512styled-by-prettify" style=3D"color:rgb(0,0,0)"> </span=
><span class=3D"gmail-m_6118346933421255512styled-by-prettify" style=3D"col=
or:rgb(102,102,0)">&gt;);</span></div></code></div>and if we catch exceptio=
n in continuation, we can rethrow it to caller context in context_exit<br>o=
r I don&#39;t understand some use cases?<br></div></div></div></blockquote>=
</div><br>if you throw an exception in the middle of your continuation and =
it it escapes the top-level continuation you have no guaranttee that the ca=
lling continuation is still valid (might resumed and termianted already)<br=
></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/CA%2Bwfc19hFNcyjVn%3DoiFn%2Brf%3DzUYY=
yxjmZ-Zp-wDiK2n61DqeaA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoo=
ter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CA%2Bwfc1=
9hFNcyjVn%3DoiFn%2Brf%3DzUYYyxjmZ-Zp-wDiK2n61DqeaA%40mail.gmail.com</a>.<br=
 />

--001a11c03ed8835fdd0549a9344e--

.
