<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Thank you for the detailed background on threads on windows!<o:p></o:p></p>
<p class="MsoNormal">We will give it a shot to get BOLT available on the platform.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Maksim<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 11/3/21, 1:28 AM, "Martin Storsjö" <martin@martin.st> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">On Wed, 3 Nov 2021, Maksim Panchenko via llvm-dev wrote:<br>
<br>
> The Windows build was disabled due to the usage of threads, IIRC.<br>
> Although, we don't use them directly, only via the C++11 standard<br>
> library. I don't have access to a windows box to test it myself.<br>
<br>
C++11 threads should be usable on Windows too, in general.<br>
<br>
If building with GCC/libstdc++, there's two compiler configurations, the <br>
"win32 thread model" which doesn't provide the full C++11 thread support, <br>
and the "posix thread model" which is configured to run libgcc and <br>
libstdc++ on top of libwinpthread, which does support C++11 threads. I <br>
suspect this is what you've run into.<br>
<br>
The mingw cross compilers in debian/ubuntu ship both configurations, but <br>
default to the "win32 thread model" without libwinpthread. There, you can <br>
choose the other one by invoking e.g. "x86_64-w64-mingw32-g++-posix", i.e. <br>
there are compiler frontends with -win32 and -posix suffixes in addition <br>
to the default.<br>
<br>
I think the LLVM codebase also uses some bits of C++11 threads/mutexes <br>
somewhere, because I remember that cross compiling LLVM with the <br>
debian/ubuntu provided mingw compilers requires using the -posix suffixed <br>
tools. So with that in mind, this shouldn't be any additional limitation <br>
compared with what LLVM requires already.<br>
<br>
Also, if building for Windows with a toolchain that uses libc++ (which is <br>
also usable in mingw configurations) or MSVC STL, then there's no <br>
ambiguity, C++11 threads are always available.<br>
<br>
// Martin<o:p></o:p></p>
</div>
</div>
</body>
</html>