220 4555 <CAPXezF8T+ZGjbcsrJyXxg3dTZmOJtAcPFZENvJ9qrug4xrMUOg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Fernando Cacciola <fernando.cacciola@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: N3558 :A standardized representation of
 Asynchronous operation
Date: Fri, 24 May 2013 17:19:55 -0300
Lines: 130
Approved: news@gmane.org
Message-ID: <CAPXezF8T+ZGjbcsrJyXxg3dTZmOJtAcPFZENvJ9qrug4xrMUOg@mail.gmail.com>
References: <519F9E48.7050700@wanadoo.fr> <c959abc7-55a0-4a6a-9b20-9752cbe63af0@isocpp.org>
 <519FB94F.7090703@wanadoo.fr> <CAPXezF-CetHBMQBWNeNFmAVvn159g9iwaK60WLBN7mW8+ZAjHw@mail.gmail.com>
 <CAFk2RUaTOwE-LcbOYXMRbd4hsNpdDSxUq8wFWKw-yff1_cK7ag@mail.gmail.com> <CAPXezF_WFhcoPHg2yW13jSt5f9NgP7veGaeSnNH3GkzvGK9eyQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=14dae93d8eac19a04c04dd7c88cc
X-Trace: ger.gmane.org 1369426836 5520 80.91.229.3 (24 May 2013 20:20:36 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 24 May 2013 20:20:36 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCOPV7FAXQPRBFEX76GAKGQEHJIZLHY@isocpp.org Fri May 24 22:20:38 2013
Return-path: <std-proposals+bncBCOPV7FAXQPRBFEX76GAKGQEHJIZLHY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f197.google.com ([209.85.212.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCOPV7FAXQPRBFEX76GAKGQEHJIZLHY@isocpp.org>)
	id 1UfyTd-0004uU-5o
	for gclcip-std-proposals@m.gmane.org; Fri, 24 May 2013 22:20:37 +0200
Original-Received: by mail-wi0-f197.google.com with SMTP id hq7sf161592wib.8
        for <gclcip-std-proposals@m.gmane.org>; Fri, 24 May 2013 13:20:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere: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-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=hyWSwQ/191zoVIbbAl5OmMQnwV0+xW+z7ErZlSRjg8M=;
        b=oWkkH8X8gYtlNrQ/yjiLcdJWHu3loAWZB9hLXxdHfTqm/5yiU7XVm1fPetjCA28q+M
         qRLQLx3V1J9DTjPckFkEh2LE+kUFC3RpV5mZO3lAsUlRUadH+Rn4wYga4YWiI7FBO448
         FSx+yD5VffwM5MTYi4mlPnn2qTjUjyGJB4TJtDZzWuVUMgzzXeiwJYDh8EY/WZkumarZ
         0BmpMZ/Gwc4vyHn/bTGlmMFe96TKCEbR5AkzIAnmqfSAzdri2zfw1HTWQ01UgPkZmbOo
         TDzMbQOPhXyMC/Gpt3onFfonw5jEyFt7uQicrLGho0Gh13NU4qcgmjxlzqFSzdwvjl0i
         1GtQ==
X-Received: by 10.152.2.10 with SMTP id 10mr3281008laq.2.1369426836819;
        Fri, 24 May 2013 13:20:36 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.5.33 with SMTP id p1ls54626lap.98.gmail; Fri, 24 May 2013
 13:20:36 -0700 (PDT)
X-Received: by 10.112.171.202 with SMTP id aw10mr9644465lbc.32.1369426836093;
        Fri, 24 May 2013 13:20:36 -0700 (PDT)
Original-Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [2a00:1450:4010:c03::22e])
        by mx.google.com with ESMTPS id pm6si6092683lbb.129.2013.05.24.13.20.36
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 24 May 2013 13:20:36 -0700 (PDT)
Received-SPF: pass (google.com: domain of fernando.cacciola@gmail.com designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e;
Original-Received: by mail-la0-f46.google.com with SMTP id er20so4908322lab.33
        for <std-proposals@isocpp.org>; Fri, 24 May 2013 13:20:36 -0700 (PDT)
X-Received: by 10.112.73.135 with SMTP id l7mr9732672lbv.42.1369426835904;
 Fri, 24 May 2013 13:20:35 -0700 (PDT)
Original-Received: by 10.114.96.200 with HTTP; Fri, 24 May 2013 13:19:55 -0700 (PDT)
In-Reply-To: <CAPXezF_WFhcoPHg2yW13jSt5f9NgP7veGaeSnNH3GkzvGK9eyQ@mail.gmail.com>
X-Original-Sender: fernando.cacciola@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of fernando.cacciola@gmail.com designates 2a00:1450:4010:c03::22e as
 permitted sender) smtp.mail=fernando.cacciola@gmail.com;       dkim=pass header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4555
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4555>

--14dae93d8eac19a04c04dd7c88cc
Content-Type: text/plain; charset=ISO-8859-1

On Fri, May 24, 2013 at 5:16 PM, Fernando Cacciola <
fernando.cacciola@gmail.com> wrote:

> On Fri, May 24, 2013 at 5:07 PM, Ville Voutilainen <
> ville.voutilainen@gmail.com> wrote:
>
>>
>>
>>
>> On 24 May 2013 22:46, Fernando Cacciola <fernando.cacciola@gmail.com>wrote:
>>
>>> I understand what this solves. The drawback is that we need to to
>>> iterate over the vector of futures when the when_any function could know
>>> about the index of the future on the vector.
>>>
>>>> Returning future<pair<size_t, vector<future<R>>>> would provide
>>>> efficiency and safety.
>>>>
>>>> What if you had more than one simultaneous result?
>>>
>>>
>> Then the size_t gives you the one that was noticed first, and the rest
>> are still in the vector?
>>
>> But you would not know if you got just one result, so you would
> nonetheless scan the whole vector just the same.
>
> future<pair<vector<size_t>,vector<future<R>>>> would fix that, but it's
> getting complex.
>
> Scratch that.

The implementation would notice *only one* first so it can return that one
right away (and like you said the rest are still in the vector)

-
Fernando Cacciola
SciSoft Consulting, Founder
http://www.scisoft-consulting.com

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



--14dae93d8eac19a04c04dd7c88cc
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On F=
ri, May 24, 2013 at 5:16 PM, Fernando Cacciola <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:fernando.cacciola@gmail.com" target=3D"_blank">fernando.cacciol=
a@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra">=
<div class=3D"gmail_quote"><div class=3D"im">On Fri, May 24, 2013 at 5:07 P=
M, Ville Voutilainen <span dir=3D"ltr">&lt;<a href=3D"mailto:ville.voutilai=
nen@gmail.com" target=3D"_blank">ville.voutilainen@gmail.com</a>&gt;</span>=
 wrote:<br>


<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div class=3D"gmail_ext=
ra"><br><br><div class=3D"gmail_quote"><div>On 24 May 2013 22:46, Fernando =
Cacciola <span dir=3D"ltr">&lt;<a href=3D"mailto:fernando.cacciola@gmail.co=
m" target=3D"_blank">fernando.cacciola@gmail.com</a>&gt;</span> wrote:<br>



<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra">=
<div class=3D"gmail_quote"><div>I understand what this solves. The drawback=
 is that we need to to
    iterate over the vector of futures when the when_any function could
    know about the index of the future on the vector. <br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div bgcolor=3D"#FFFFFF" text=3D"#000000">
    Returning future&lt;pair&lt;size_t,
    vector&lt;future&lt;R&gt;&gt;&gt;&gt; would provide efficiency and
    safety.<span><font color=3D"#888888"><br>
    <br></font></span></div></blockquote></div><div>What if you had more th=
an one simultaneous result?<span><font color=3D"#888888"><br></font></span>=
</div></div><span><font color=3D"#888888"><br>
</font></span></div></div></blockquote><div><br></div></div><div>Then the s=
ize_t gives you the one that was noticed first, and the rest are still in t=
he vector? <br></div></div><br></div></div></blockquote></div><div>But you =
would not know if you got just one result, so you would nonetheless scan th=
e whole vector just the same.<br>


<br></div><div>future&lt;pair&lt;vector&lt;size_t&gt;,vector&lt;future&lt;R=
&gt;&gt;&gt;&gt; would fix that, but it&#39;s getting complex.<br clear=3D"=
all"></div></div><div class=3D"im"><br></div></div></div></blockquote><div>

Scratch that.<br><br></div><div>The implementation would notice *only one* =
first so it can return that one right away (and like you said the rest are =
still in the vector)<br><br></div></div>- <br>Fernando Cacciola<br>SciSoft =
Consulting, Founder<br>

<a href=3D"http://www.scisoft-consulting.com">http://www.scisoft-consulting=
..com</a>
</div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--14dae93d8eac19a04c04dd7c88cc--

.
