The ScalaJS linker is consuming a lot of memory. Running multiple instances in parallel can drastically reduce throughput on a system. In the worst case, this can bring the whole Mill process to a stop due to a OutOfMemory exception. Therefore we should limit the maximal number of parallel running linker processes. Meaning, we just wait and block until a slot becomes free. This should be implemented in ScalaJSWorker, which is already shared between all ScalaJsModules.
Originally posted by @lefou in #6207 (comment)