Parallel input file parsing

int3:
Or we could make a thread-safe bump allocator :slight_smile: It seems like a generally useful thing to have in LLVM…

tschuett
Maybe there is more in LLVM than just a ThreadPool …
Maybe there is need in LLVM for more complex concurrent data structures than just a ThreadPool.

I feel those two topics point out again the lack in LLVM of thread-safe, lock-free containers & memory allocator. This boils down to the question of whether we should reference or vendor external packages from LLVM. Right now it seems that only “optional” external libs are referenced by LLVM, and any “required” external library has to duplicated/vendored in the monorepo (and inherently fit the LLVM licence).

Writing a cross-platform, lock-free allocator isn’t trivial (although we have SCUDO), and nor is re-writing all the common containers (map, vector, deque, etc) in a thread-safe, lock-free manner.
If we could rely on IntelTBB, that would solve both raised issues (since IntelTBB has tbbmalloc). Adding in mimalloc or rpmalloc would further improve the situation.

Would it be an option to let LLD rely on external submodules?

2 Likes