Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Why are the strands in the " HTTP Server 3" example necessary?
From: Boris Haeberlein (tacheon_at_[hidden])
Date: 2010-01-08 03:22:06


Boris Schaeling <boris <at> highscore.de> writes:

>
> On Thu, 07 Jan 2010 12:22:39 +0100, Tacheon <tacheon <at> gmx.de> wrote:
>
> > In the HTTP Server 3 (http://tinyurl.com/yh95d2b) example of the asio
> > documentation strands are used to synchronize the invocation of
> > completion handlers? But why are they necessary here? As far as I get
> > it, the handlers are invoked in strict sequential order for each
> > distinct connection (http://tinyurl.com/ybohynd). Each connection has
> > its own set of resources so synchronization shouldn't be necessary,
> > should it?
>
> I quickly checked the connection class and couldn't find a reason either
> why strand is used here. The comment in connection.hpp (///Strand to
> ensure the connection's handlers are not called concurrently) doesn't make
> any sense as a new asynchronous operation is only started when another
> ends. Maybe the strand is left over from an earlier version of the HTTP
> server?
>
> Boris
>
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 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.


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