[asio-users] is it possible to use asio in level-triggered mode?
Brought to you by:
chris_kohlhoff
From: Daniel H. <dan...@gm...> - 2015-04-23 05:02:45
|
I see by inspecting the source code that asio uses edge-triggered epoll on linux. I also see some history from circa 2009-2010 where this design decision was evaluated for performance reasons. It makes sense to me. However, I cannot seem to make edge-triggered mode compatible with libcurl if libcurl is used in the "event-driven multi" mode where the app handles all notifications and interacts with curl entirely through callbacks. Although you can accomplish identical goals with both edge-triggered and level-triggered designs, the division of responsibilities between libcurl and the application that uses it makes this quite difficult in my scenario. See this post on the libcurl mailing list: http://curl.haxx.se/mail/lib-2015-04/0104.html There is a sample piece of code that demonstrates an integration between asio and libcurl in the libcurl codebase, but it no longer works. I was able to confirm that it was written before this design change to asio propagated, and that the breakage traces to this evolution of asio. I am wondering if the asio team would accept a patch that would allow the edge-vs-level-triggered decision to be configurable (e.g., as an arg to the ctor of an io_service object), so that level-triggered usage becomes possible again. I realize that this would decrease asio performance to some extent, but would that do a lot of violence to other internals or other design imperatives? --Daniel |