Re: [asio-users] Strands
Brought to you by:
chris_kohlhoff
From: Niall D. <s_s...@ne...> - 2017-02-28 23:10:35
|
> Can you please provide me with some glues where do I have to look in > order to understand the way how strands are scheduled ( file, lineNo ). > I would really appreciate your help. If I am able to find the cause, I > will push the fix via GitHub... I love one source in both directions - > using and giving :) Unfortunately I have no cause to use ASIO unless it's due to a contract of work, and indeed the last time I touched ASIO was due to a work contract nearly two years ago. As some may be aware, I am (very slowly) writing a new Boost library called AFIO which uses a *very* different io_service reactor design to ASIO. > @Niall - offtopic - the issue with the signal that is broadcasted > without a mutex lock. https://svn.boost.org/trac/boost/ticket/12690 - It > has nothing to do with the strands. I am also pretty sure, that the > solution in the link is the right one. Can you please tell me the > closest way of integrating the solution ? GitHub? SVN ? ..... >From first inspection I'd have called that a spurious warning safely ignored. ASIO is probably using a spinloop with thread yield for fast wakeup, hence the sanitiser warning about synchronised via sleep. It's safe to signal condition variables outside their mutex if you have a concurrency safe method of flagging the wakeup in parallel to the condvar. I tend to use an atomic<bool> for that purpose a lot as a lot of the time you can skip the condvar entirely using lock free programming. It also keeps the clang sanitiser quiet. But as I mentioned I haven't checked the ASIO source code. Chris generally knows what he's doing though. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/ |