Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Why are the strands in the " HTTP Server 3" example necessary?
From: Boris Schaeling (boris_at_[hidden])
Date: 2010-01-08 07:16:54


On Fri, 08 Jan 2010 09:22:06 +0100, Boris Haeberlein <tacheon_at_[hidden]>
wrote:

> [...]I were just wondering because the example is mentioned in the
> strand-section of
> the overview. So this might just be a bad example?

I just checked the other strand example at
http://www.boost.org/doc/libs/1_41_0/doc/html/boost_asio/tutorial/tuttimer5.html.
This makes sense to me but not the HTTP server 3.

> I am still not sure about this. In the strand-overview
> (http://tinyurl.com/ya7g5g3) there is also a passage about composed
> operations
> and intermediate handlers which I don't understand. It might be that
> this is
> true for the HTTP 3 example.

A composed operation is eg. async_read() which "is implemented in terms of
zero or more calls to the stream's async_read_some function" (see
http://www.boost.org/doc/libs/1_41_0/doc/html/boost_asio/reference/async_read/overload1.html).
But the HTTP server 3 calls async_read_some() through a strand (which is
not a composed operation).

The HTTP server 3 also calls async_write() which is a composed operation.
However I can't see any intermediate handlers (there is no other
asynchronous operation started after async_write() is called; thus there
is no handler which could be called between handlers invoked by
async_write_some() - the asynchronous operation async_write() is composed
of).

Boris


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