28 Mar
2014
28 Mar
'14
5:17 a.m.
On 28/03/2014 00:09, quoth Bjorn Reese:
Looking at the new numbers for the optimized build, the main difference between the synchronous and asynchronous case is due to the internals of the asio::io_service queue (primarily locking.)
FWIW, that matches my own testing results. I had a case (with serial ports) where this locking latency was sufficiently high to be bothersome. I wrote an experimental lock-free reactor engine which appears to outperform Asio (at least on Windows) -- but it's also much more limited and doesn't provide some of the same guarantees. For normal (particularly socket) usage it's probably not worth the hassle.