Boost logo

Boost Users :

Subject: Re: [Boost-users] Using Coroutines in the Visitor Pattern (use-case: BGL event visitor)
From: alex (alexhighviz_at_[hidden])
Date: 2016-01-18 10:36:58


>From: Boost-users [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
>Oliver Kowalke
>Sent: 15 January 2016 18:55
>2016-01-15 18:46 GMT+01:00 alex <alexhighviz_at_[hidden]>:
>
> I just tried it on a graph with 3 million nodes. With your solution and
>the
> additional cost is 11%, so I would say it is superior on all accounts. I
> just wish I knew this earlier.
>
> boost coroutine visitor (Nat Goodspeed)...1890 ms
>
>
>
>Could test it again with boost.coroutine2 + boost.context from branch develop
>and post the result?
>
Sorry that is too much work for me now. But I am happy to share the program I used with you.

To get Nat's method to work for me, I used the following:

    while (dijkstra_object) {
      dijkstra_object();
    }

Where dijkstra_object is a boost::coroutines::asymmetric_coroutine<Vertex>::pull_type.

It was somehow disappointing that I couldn't simply do:

    while (dijkstra_object() )
   { }

I can see in the documentation that the constructor enters the coroutine-function, but it is not clear to me why. Would it not have been neater if this was avoided?


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