Opened 8 years ago

Closed 8 years ago

#10833 closed Feature Requests (wontfix)

boost::async should support auto scheduling (launch deferred)?

Reported by: adishavit@… Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

One of the design choices for std::async() default launch policy was to allow the OS scheduler to decide whether or not to launch a new thread or remain on the same thread (presumably based on available system resources). Boost::async() does not seem to support this default auto scheduling yet? It seems to be launching as many threads as tasks.

Change History (9)

comment:1 by viboes, 8 years ago

What would be for you the criteria to switch to defer?

comment:2 by viboes, 8 years ago

Owner: changed from Anthony Williams to viboes

comment:3 by adishavit@…, 8 years ago

This should be based on system load as determined by the OS. At least this is how Herb Sutter presented it in one of his talks, and how Scott Meyers claims it should work.

comment:4 by viboes, 8 years ago

I would need something more precise. DO you have some pointers?

comment:5 by adishavit@…, 8 years ago

Effective Modern C++, item 35: "Your life will be easier if you dump these problems on somebody else, and using std::async does exactly that:

auto fut = std::async(doAsyncWork); onus of thread mgmt is on implementer of the Standard Library

This call shifts the thread management responsibility to the implementer of the C++ Standard Library...When it comes to load balancing, however, the runtime scheduler is likely to have a more comprehensive picture of what’s happening on the machine than you do, because it manages the threads from all processes, not just the one your code is running in.

comment:6 by viboes, 8 years ago

Unfortunately this is not the case of Boost.Thread.

comment:7 by adishavit@…, 8 years ago

OK.

comment:8 by viboes, 8 years ago

Type: BugsFeature Requests

comment:9 by viboes, 8 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.