[Boost-bugs] [Boost C++ Libraries] #13317: io_service behaviour difference between ubuntu and msvc-14

Subject: [Boost-bugs] [Boost C++ Libraries] #13317: io_service behaviour difference between ubuntu and msvc-14
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-12-01 16:54:35


#13317: io_service behaviour difference between ubuntu and msvc-14
----------------------------------------------+----------------------------
 Reporter: Diego Barrios Romero <eldruin@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.62.0 | Severity: Problem
 Keywords: |
----------------------------------------------+----------------------------
 When implementing a basic thread pool using boost::asio::io_service, I am
 observing some differences in how queued tasks are handled when stopping
 the io_service.

 On MSVC 14 (MS Visual Studio 2015), for some reason the queued tasks which
 were not started yet are not dropped when stopping the io_service but are
 run nonetheless.
 These tasks are dropped when running this on Ubuntu 16.04 (GCC 5.4.0).

 I have simplified and cleaned up the original tests and put them in a
 single file (attached) which only depends on boost and uses some sleeps to
 demonstrate the problem.
 You can build it with the CMakeLists.txt attached if you wish.

 The output on Ubuntu is as expected:
 {{{
 checkAllWorkIsProcessedBeforeDestruction
         passed.
         passed.
         passed.
 checkWorkCanBeCancelled
         passed.
         passed.
         passed.
 checkWorkCanBeInterrupted
         passed.
         passed.
         passed.
 checkUninterruptableWorkIsNotInterruptedButCanBeDropped
         passed.
         passed.
         passed.
         passed.
 }}}

 This is the output on MSVC 14:
 {{{
 checkAllWorkIsProcessedBeforeDestruction
         passed.
         passed.
         passed.
 checkWorkCanBeCancelled
         Error: functor 1 call expected: false current: true
         Error: functor 2 call expected: false current: true
         Error: running time expected: 150 current: 402
 checkWorkCanBeInterrupted
         passed.
         passed.
         passed.
 checkUninterruptableWorkIsNotInterruptedButCanBeDropped
         passed.
         Error: functor 2 call expected: false current: true
         passed.
         Error: running time expected: 250 current: 404
 }}}

 Am I doing something wrong?

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13317>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-12-01 17:01:26 UTC