[asio-users] Strange strand dispatch issue on windows
Brought to you by:
chris_kohlhoff
From: Wade B. <wbe...@gm...> - 2014-06-30 22:26:18
|
Hello, Attached is a test program testing strand::dispatch(). First question: is it reasonable to depend on the ordering of the print statements? Assuming that is the case (which it seems to be, according to the documentation regarding dispatch()), I'm seeing a case on Windows where this isn't happening. #2 and #3 get swapped when either: a. asio is compiled as a shared library according to the documentation (ie: compiling boost/asio/impl/src.hpp and defining BOOST_ASIO_DYN_LINK) b. asio is being used as header only, but my executable is loading a dll that is calling dispatch on a strand allocated by the host executable. Second question: is this a bug? My Windows setup: -Visual Studio 2010 SP1 32bit -Windows XP (seeing the same behavior on Windows 7) -Boost 1.55 variant=release thread=multi link=shared Also, I've run depends.exe on the .dll and .exe to verify that I'm not mixing release/debug runtime .dlls, which seemed like it could have been the culprit. Note, both of these cases work as expected on linux. In tracing the code, it seems to come down to callstack::contains returning false when it should be returning true, and callstack is using thread local storage to maintain that data. Any thoughts, pointers, or fixes would be greatly appreciated. Wade Berrier |