FreeCAD: master e0a814bf

Author Committer Branch Timestamp Parent
abdullah abdullahtahiriyo master 2020-12-19 05:38:46 master 28415f53
Changeset GCS: Change asynchronous launch policy to default to avoid having to take care of exceptions on oversubscription

================================================================================================================

std:async can take two policies one that forces the task to be run in parallel another (deferred) that runs the task
when wait is called on the future (kind of lazy evaluation).

Default policy is let the system decide (an or of both policies). Nobody is a better position than the system to know
its load and whether it is possible to run the task in parallel or not.

If the system cannot allocate a thread and parallel processing is enforced (as before this commit), then it will throw an
exception. In the present case we would catch it and run the task sequencially. Thus, it makes sense to let the system
decide from the beginning and save the exception and the handling.

In tests I have only managed to see it run in parallel with the default policy.
mod - src/Mod/Sketcher/App/planegcs/GCS.cpp Diff File