[cfe-dev] cland and multi-threading

Paul Curtis plc at rowley.co.uk
Fri Dec 10 08:02:49 PST 2010


Hi Doug,

> > I have another question, which I couldn't readily find the answer
> for.
> >
> > Given a single CXIndex, is it possible to run two (or more) parses
> > using the clang API in parallel?  That is, could I create two threads
> > and have two
> > clang_parseTranslationUnit() calls running in different threads,
> using
> > different translation units, concurrently?
> 
> Yes. Just don't access the same CXTranslation unit in two different
> threads concurrently.

I twigged this one by looking at the implementation of part of the API
implementation.  :-)

Thanks for the help,

-- Paul.





More information about the cfe-dev mailing list