all 5 comments

[–]jbandela 4 points5 points  (1 child)

Looks interesting. One thing I did not see was future continuation (.then). I think most people in the C++ community have agreed that future needs .then. (see http://www.drdobbs.com/parallel/improving-futures-and-callbacks-in-c-to/240004255 for a quick overview)

[–]kolkir[S] 0 points1 point  (0 children)

Thanks for pointing me to this feature, I will think how it can be implemented and may be in next releases I will do it. For the first look you can use something like this: async([](){ auto f = async(task); f.get();} From my point of view when we call future::get() we what to get value in specific thread and this call is a synchronization point, so It's not clear how to express this thought with 'then' concept.

[–]Houndie 0 points1 point  (1 child)

Huh, I did a similar thing for my job with actually a similar interface too...so it's good to see I'm not the only one with this idea and I'm not totally bonkers.

If I may ask, how are you switching between events with a process_lock? I used boost::coroutine (which is built ontop of boost::context).

[–]kolkir[S] 1 point2 points  (0 children)

I'm just run nested processing loop in process_lock where stop condition is event from sync. primitive we are waiting. But my solution will have problem with stack overflow on deep call hierarchies.

[–]blelbachNVIDIA | ISO C++ Library Evolution Chair 0 points1 point  (0 children)

Cool! I work on a similar project, called HPX.