Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 May 2006 11:23:23 +0100
From:      Richard Collyer <richard@firebadger.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Please explain make -j to my little brain
Message-ID:  <4468569B.6060706@firebadger.net>
In-Reply-To: <200605151112.33416.work@ashleymoran.me.uk>
References:  <200605151112.33416.work@ashleymoran.me.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Ashley Moran wrote:
> Hi
> 
> I've read the following snippet out of the handbook hundreds of times and 
> still don't understand it.  I even asked one of the developers I work with 
> and he was baffled too.
> 
>> It is now possible to specify a -j option to make which will cause it to
>> spawn several simultaneous processes. This is most useful on multi-CPU
>> machines. However, since much of the compiling process is IO bound rather
>> than CPU bound it is also useful on single CPU machines.
> 
> What I want to know is, if compiling is IO bound, and you increase the number 
> of simultaneous processes compiling your world, where do the extra processes 
> get data from if the IO bandwidth is all used.
> 
> Have I misunderstood the term IO bound?  Please help, I feel like a right 
> tool.
> 
> Just as a side line... does anybody know the best -j value to build world on a 
> 4-core box?

The way I understand it is that 1 core would do this...

compile .... read disk .... compile .... read disk ... compile

It wont be reading when it is compiling and cant compile when its 
reading so if you do -j 2 even on a single core machine it could do:

compile .... read disk .... complile .... read disk ... compile
read disk .... complile .... read disk ... compile .... read disk

Which means neither the CPU or the disks are idle resulting in faster 
performance.

Cheers
Richard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4468569B.6060706>