<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi,<br><br></div><div class="gmail_default" style="font-size:small">Unfortunately, it isn't quite as simple as switching to the existing STL implementation as Owen suggested. The existing STL implementation is not entirely Windows friendly and can cause various crashes on exit too. We have some local patches to workaround these issues. I posted an "enhanced" Windows & Linux version of these local patches in
<a href="https://reviews.llvm.org/D40366" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D40366</a> as a potential solution to a crash on exit problem seen on Linux (see llvm-commits thread "std::thread::detach() rarely crashes in Parallel.cpp").<br><br></div><div class="gmail_default" style="font-size:small">So to disable the use of PPL on Windows would require some changes to the existing STL implementation.<br><br></div><div class="gmail_default" style="font-size:small">Cheers,<br></div><div class="gmail_default" style="font-size:small">Andrew<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 February 2018 at 16:32, Rafael Avila de Espindola via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thank you so much for tracking down such a tricky issue.<br>
<br>
I agree that we should disable it. Should we just delete the ifdefs? We<br>
could in theory disable it just for debug builds, but that could create<br>
some hard to reproduce bugs.<br>
<br>
Cheers,<br>
Rafael<br>
<div><div class="gmail-h5"><br>
Owen Reynolds via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> writes:<br>
<br>
> Hello all,<br>
><br>
> Last year I submitted a bug regarding the use of 'parallel_for_each' and<br>
> Windows Concurrency Library. We have found that when compiling in Visual<br>
> Studio 2015 and 2017 with /MTd, the use of 'concurrency::parallel_for_<wbr>each'<br>
> can cause unhandled exceptions when the program is exiting.<br>
><br>
> <a href="https://bugs.llvm.org/show_bug.cgi?id=34976" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=34976</a><br>
><br>
> After having some difficulty clarifying this issue with Microsoft I<br>
> submitted the issue again this week and have found that they are aware of<br>
> the problem. However, I've yet to be given any information on a timescale<br>
> for a fix.<br>
><br>
> <a href="https://developercommunity.visualstudio.com/content/problem/198027/use-of-concurrencyparallel-for-each-with-the-multi.html" rel="noreferrer" target="_blank">https://developercommunity.<wbr>visualstudio.com/content/<wbr>problem/198027/use-of-<wbr>concurrencyparallel-for-each-<wbr>with-the-multi.html</a><br>
><br>
> For our team this bug has caused problems when testing LLD. We suggest the<br>
> removal of this MSVC specific functionality in "llvm::parallel" until a fix<br>
> is made or alternative found. This could be easily swapped to use the<br>
> existing standard library implementation in the meantime.<br>
><br>
> Owen Reynolds<br>
</div></div>> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div></div>