asio-tr2 icon indicating copy to clipboard operation
asio-tr2 copied to clipboard

Consider design issue of whether running_in_this_thread should be provided

Open chriskohlhoff opened this issue 10 years ago • 2 comments

Or just used as an implementation detail for specification.

chriskohlhoff avatar Feb 25 '15 08:02 chriskohlhoff

One of the reasons it was originally added to asio was a feature request from a user:

http://sourceforge.net/p/asio/feature-requests/20/

chriskohlhoff avatar Apr 11 '15 11:04 chriskohlhoff

Pre-Lenexa Summary

[io_service.exec], [async.strand]

The proposal from Cologne is that this function might be removed.

My view is that this function should be kept. It simplifies the specification of some of the other member functions. Furthermore, it was originally added to Asio in response to a user feature request -- they wanted to be able to assert whether code was running inside a strand. Uses of it have also appeared "in the wild":

http://stackoverflow.com/questions/26570120/is-there-a-way-to-check-whether-a-stackful-coroutine-is-in-the-context-of-a-give

https://groups.google.com/forum/#!msg/automatak-dnp3/wFajnn7VN4E/dFWfXUu53IYJ

So I would suggest that some Asio users have found it useful.

chriskohlhoff avatar May 05 '15 11:05 chriskohlhoff