Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Asio] defer, dispatch and post differences?
From: Richard Hodges (hodges.r_at_[hidden])
Date: 2018-01-05 15:53:37


I have a feeling that a better reference might be the latest TS document (
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4711.pdf) since
that's more likely to be rigorously scrutinised and maintained.

defer and dispatch have this to say:

" 1 [ Note: The function defer satisfies the requirements for an
asynchronous operation (13.2.7), except for the requirement that the
operation uses post if it completes immediately. — end note ]"

which seems to suggest that defer and dispatch are allowed to invoke the
completion handler immediately while post is not. Perhaps defer does a post
unless the handler is a continuation? I think that would make sense.

R

On 5 January 2018 at 16:36, Vinnie Falco via Boost-users <
boost-users_at_[hidden]> wrote:

> On Fri, Jan 5, 2018 at 7:21 AM, Richard Hodges via Boost-users
> <boost-users_at_[hidden]> wrote:
> > When I had a query regarding the newer standalone boost, I emailed Chris
> > directly. He very helpfully replied promptly and fully.
>
> I emailed him too, several months ago, and this is what I got back:
>
> post() -> handler_is_continuation() == false
> defer() -> handler_is_continuation() == true
>
> > Every piece of information you need is there, exactly once, with not even
> > one character more than is necessary to aid understanding.
>
> Yeah I know what you mean. It is quintessentially D.R.Y..
>
> I'll note that Asio does not use defer() anywhere in its
> implementation. I have not found any code which demonstrates its use.
>
> Thanks
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net