[cfe-dev] Thread pool for llvm::CrashRecoveryContext::RunSafelyOnThread ?

Milian Wolff mail at milianw.de
Mon Apr 28 11:04:49 PDT 2014


Hey all,

while looking at a tool that uses clang-c to parse a lot of files in GDB, I 
noticed that every call to clang_parseTranslationUnit triggers a call to 
pthread_create.

#0  0x00007fe4fa0cc2d4 in pthread_create@@GLIBC_2.2.5 () from 
/usr/lib/libpthread.so.0
#1  0x00007fe44e2fc630 in llvm::llvm_execute_on_thread(void (*)(void*), void*, 
unsigned int) () from /usr/lib/libLLVM-3.4.so
#2  0x00007fe44e2d8e53 in llvm::CrashRecoveryContext::RunSafelyOnThread(void 
(*)(void*), void*, unsigned int) ()
   from /usr/lib/libLLVM-3.4.so
#3  0x00007fe44f34a293 in clang_parseTranslationUnit () from 
/usr/lib/libclang.so

Would it not be better, performance-wise, to recycle the threads in a thread 
pool?

I'm using clang 3.4 btw.

Thanks
-- 
Milian Wolff
mail at milianw.de
http://milianw.de



More information about the cfe-dev mailing list