<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 19, 2017 at 7:58 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</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">Michael, what is the correct way to handle std::thread's constructor<br>
failing when exceptions are disabled?<br>
<span class="gmail-im gmail-HOEnZb"><br>
Cheers,<br>
Rafael<br></span></blockquote><div><br></div><div>There isn't a way. I checked both libc++ and libstdc++ and they both call abort if creating a thread fails with exceptions disabled. I wonder if it's worth adding a way to handle this to the std.</div><div><br></div><div>As for now, if we want to handle this case we'll need our own thread creation mechanism.<br><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">- Michael Spencer</div></div><div><br></div></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-im gmail-HOEnZb">
<br>
NAKAMURA Takumi via Phabricator via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> writes:<br>
<br>
</span><div class="gmail-HOEnZb"><div class="gmail-h5">> chapuni added a comment.<br>
><br>
> I guess the constructor std::thread(F) fails, then its method, detach() crashes.<br>
> If we live with -fno-exceptions, I think we may rewrite Parallel.cpp w/o C++11 std::thread, but with pthreads, to catch failure in pthread_create.<br>
><br>
> Or, could I increase any resources in ulimit/kernel? I tried idea that I knew.<br>
> I will attempt to find out with -fexceptions which error would raise.<br>
><br>
> FYI, I am using 36-core (72 logical processors) host.<br>
><br>
><br>
> Repository:<br>
>   rL LLVM<br>
><br>
> <a href="https://reviews.llvm.org/D39038" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D39038</a><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>