Hacker News new | ask | show | jobs
by dholm 1463 days ago
Does mold support jobserver or some other mechanism to throttle threads?

We use lld currently but had to disable threading as sometimes in CI several of our test binaries would get linked at the same time. Whenever this happened the lld instances appear to have spawned enough threads to overload our Jenkins slave to the point that the master wasn't able to reach it and failed the build.

2 comments

It's being discussed (https://github.com/rui314/mold/issues/117) but haven't reached any conclusion. The problem is that the jobserver protocol assumes that one process is one job, and its model doesn't fit very well to programs such as mold.
Thank you rui314. There is a lot of good information collected in that issue.
If you use Ninja, you can create a job pool for linking, separate from compiling, and restrict how many simultaneous linker jobs are run. You can even create and set job pools for Ninja through CMake, if you use that in your tooling.

Unfortunately GNU Make offers no such mechanism. And for Ninja build generation I don't think Meson does it either.

I was not aware of this feature and we do use CMake. Thank you for letting me know about it!