[llvm-dev] LLVM and Pthreads

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sat May 6 08:22:50 PDT 2017


On 6 May 2017 at 04:16, Iulia Stirb via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I know clang supports -pthread option (here). Does this mean I can call
> pthread routines inside llvm code

LLVM itself can run when pthreads isn't available, so while some parts
do use pthreads they have alternative implementations for other
systems. Take a look at Mutex.cpp for example: the default is Posix
but there's a Windows specific version in lib/Support/Windows.

> and which pthread library is used, the one for Linux OS or the one for Windows?

There's never (to my knowledge) a situation where both of those are
valid answers: if you're running on Linux you'll use a Linux library,
if you're running on Windows you'll use a Windows library.

Tim.


More information about the llvm-dev mailing list