multithreading and the JIT, specifically llvm::sys::Memory

Hello,

We were doing some experiments to deserialize/JIT bitcode on multiple threads and we hit what looks like this issue:

http://lists.cs.uiuc.edu/pipermail/llvmbugs/2013-April/027937.html

We’re using LLVM-3.5 so I was a bit surprised that the patch that was provided in 2013 doesn’t appear to be in the current codebase. I’m curious what the status of this patch and issue are? Are other people multithreading their code this way?

Thanks!

Dale

Dale Martin <Dale.Martin@mathworks.com> writes:

We were doing some experiments to deserialize/JIT bitcode on multiple threads
and we hit what looks like this issue:

http://lists.cs.uiuc.edu/pipermail/llvmbugs/2013-April/027937.html

We’re using LLVM-3.5 so I was a bit surprised that the patch that was provided
in 2013 doesn’t appear to be in the current codebase. I’m curious what the
status of this patch and issue are? Are other people multithreading their code
this way?

I didn't look into it, but the bug's description states this only
happens when LLVM is built by a pre-C++11 compiler. Trunk requires C++11
these days, so is this fix even relevant anymore?

I didn't look into it, but the bug's description states this only happens when LLVM is built by a pre-C++11 compiler. Trunk requires C++11 these days, so is this fix even relevant anymore?

We're seeing this bug on win64, where we're building with Visual 2012. I don't know if you'd count it as a pre-C++11 compiler or not, or for that matter, how one would count Visual 2013, which is more C++-11 compliant but still incomplete in its support. We're considering if it is worth investigating locally applying the patch or if this is just the tip of the iceberg.

Thanks,
  Dale

It's still relevant. Our minimum supported VS version is 2013, which
doesn't have thread safe statics yet. VS 2015 will have it, but it hasn't
been officially released yet. Six CTPs and still going strong. :slight_smile:

Probably the best thing to do here is some manual atomic checking and
setting of the page size. ManagedStatic is IMO too heavyweight.