Make-j
From FBSD_tips
[edit] World
As multiple cores become more affordable and commonplace, one is always looking for ways to harness them better. One obvious answer is parallelizing make with the option -j N (where N = the number of workers). There is conflicting advise in the FBSD documentation on this is. UPDATING says :
Avoid using make -j when upgrading. From time to time in the past there have been problems using -j with buildworld and/or installworld.
And the handbook says :
On a typical single-CPU machine you would run: # make -j4 buildworld
As a matter of principal I tend to follow UPDATING in favor of other documentation as I believe it is generally "fresher". So I sought advice on the matter. The considered opinions of those that I have queried is that problems of the like mentioned in UPDATING should be immediately appearent and not cause 'silent failure', so it is safe to try a parallel build and 'fall back' to a serial build in the event of failure.
[edit] Ports
The case of ports is an entirely different matter. Because of the way the ports framework is built, two ports could attempt to install the same dependancy at the same time. Depending on timing and luck there are a couple of possible outcomes:
1) One port finishes building the depandancy and installs it, the other port finishes building the dependancy and bombs out in the install phase for it because it's now already installed
2) Both builds of the dependancy go in to the install phase at the same time and attempt to write to /var/db/pkg simultaniously, silently leaving it in an unknown inconsistant state.
A google summer of code project is underway to address parallel ports builds. More information is available [here]
Gongo 17:09, 2 October 2007 (UTC) - thanks to Jpaetzel (on ##freebsd) and Mux (on ##freebsd) for input and clarification
