[LLVMdev] Thread support: desirable or not?

Evan Jones ejones at uwaterloo.ca
Fri May 13 17:30:44 PDT 2005


Reid raised this issue in a bug comment that I thought should be 
discussed on the mailing list:

http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=540

> I'm really not sure this is wise unless there is consensus that lli 
> should always be a multi-threaded program. Certainly, there's enough 
> problems with multi-threading that this could break many tests. I'd 
> like some other folks to chime in on this before we make this change.

In order for LLVM to execute programs that are multithreaded, the JIT 
must be thread-safe. I am not aware of anyway of doing this 
"selectively." My patch 
(http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=418) adds a lock to 
ExecutionEngine.h, which means that the JIT must *always* be 
thread-safe, which means that it must always be linked against a 
platform's thread library.

So the question is: Should the JIT always have locks, and always be 
thread-safe? This question really means "should LLVM always be capable 
of executing multithreaded programs?"

Evan Jones

--
Evan Jones
http://evanjones.ca/




More information about the llvm-dev mailing list