[Mesa-dev] Threading issues with LLVM pipeline

Jose Fonseca jfonseca at vmware.com
Fri Mar 30 10:12:44 PDT 2012



----- Original Message -----
> Ok, what if I one uses a global lock around every gl call? 

What do you mean with around every gl call? You mean not on the GL driver but in the GL application? Yeah, that'd work. Though in that case there's not much point to use GL from multiple threads.

> Would that
> work with the current version of pipeline before proper thread
> support
> is in place?

LLVM is invoked from alot of places. Modifying the gallivm/llvmpipe to hold a lock when that happens is insanely hard. It's much easier to just refactor the code such that threads share no mutable obejcts.
 
Jose

> On Fri, Mar 30, 2012 at 3:42 AM, Jose Fonseca <jfonseca at vmware.com>
> wrote:
> > gallivm/llvmpipe is not thread safe.
> >
> > To fix it, we need to have separate LLVMContext / JIT engines for
> > each pipe_context (i.e., each thread).
> >
> > I'm working on a branch that does most of this, and I plan to
> > commit over the next month or so. That branch also has changes for
> > the compilation to happen per function, and not per module, so
> > that we can use MC-JIT (which will eventually supersed the current
> > JIT engine), and that part is a bit experimental and needs more
> > work, which is why I can't commit immediately.
> >
> > Jose
> 


More information about the mesa-dev mailing list