As I understand it, independent rules are executed in parallel, i.e. in
prog: a.o b.o
ld -o prog a.o b.o
a.o: a.c
cc -c a.c
b.o: b.c
cc -c b.c
(assumed the tabs are right) a.o and b.o can be 'made' in parallel. If both a.c and b.c are changed, the two cc commands can be started in parallel, after both of them exit, the ld can be started. As you can see, the level of parallelism depends on the makefile and what has to be done. In the example, assuming for simplicity both cc and ld need the same time, the maximal speedup (for every -j > 1) is 1.5.
Besides that, it's possible to give a number along with the -j option. So, "make -j 2" will spawn to processes at the same time and add a new one as soon as one of the two finishes. Likewise, "make -j 3" spawns three processes etc. Without a number, so just "make -j", all processes are spawned at the same time and the kernel scheduler is working overtime to get all processes started in the right order. This is a great way of testing the stability of your system.
Following your link www.distcc.samba.org i read the design paper .. it mentions about make -j and how it handles dependencies using graphs .
but unfortuantely it's doesnot actually say how...
I am looking for that
Anyway thanks for the link . Seems i'll have to read the make source and understand afterall
independent rules
As I understand it, independent rules are executed in parallel, i.e. in
prog: a.o b.o ld -o prog a.o b.o a.o: a.c cc -c a.c b.o: b.c cc -c b.c(assumed the tabs are right) a.o and b.o can be 'made' in parallel. If both a.c and b.c are changed, the two cc commands can be started in parallel, after both of them exit, the ld can be started. As you can see, the level of parallelism depends on the makefile and what has to be done. In the example, assuming for simplicity both cc and ld need the same time, the maximal speedup (for every -j > 1) is 1.5.
independent rules
Besides that, it's possible to give a number along with the -j option. So, "make -j 2" will spawn to processes at the same time and add a new one as soon as one of the two finishes. Likewise, "make -j 3" spawns three processes etc. Without a number, so just "make -j", all processes are spawned at the same time and the kernel scheduler is working overtime to get all processes started in the right order. This is a great way of testing the stability of your system.
distcc
http://distcc.samba.org/ <-- get it!
OK the docs refer to make but......
hi..
Following your link www.distcc.samba.org i read the design paper .. it mentions about make -j and how it handles dependencies using graphs .
but unfortuantely it's doesnot actually say how...
I am looking for that
Anyway thanks for the link . Seems i'll have to read the make source and understand afterall
anymore help greatly appreciated