Boost logo

Boost :

Subject: Re: [boost] Do you know of standard implementation of async() that blocks on the future-destructor?
From: Mikael Olenfalk (mikael.olenfalk_at_[hidden])
Date: 2015-10-12 02:36:12


VS2015 seems to block in the future destructor of std::async, see the
output from the below program:

/M

Output:

policy: async
0ms (before)
3ms (async)
10008ms (after)
 -----
policy: deferred
0ms (before)
1ms (async)
10015ms (after)

Snippet:

  {
    std::cout << print_time(begin) << " (before)" << std::endl;

    auto future = std::async([begin]() {
      std::cout << print_time(begin) << " (async)" << std::endl;
      std::this_thread::sleep_for(std::chrono::milliseconds(10000));
    });

  }
  std::cout << print_time(begin) << " (after)" << std::endl;

On Mon, Oct 12, 2015 at 2:02 AM, Vicente J. Botet Escriba <
vicente.botet_at_[hidden]> wrote:

> Hi,
>
> all is in the title.
>
> Best,
> Vicente
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk