Question: Parallel computing (again)

Sorry for posting something similar again on computing on multi-core-machines but it's really important.

So the question is:

There are two possibilities for solving a problem:

(a):
f := proc(L::list)

r1 := g( first part of L );
r2 := g( second part of L );

return [ op( r1 ) ,op( r2 )]:
end proc:

(b):

f := proc(L::list)

id1 := Create(g( first part of L ), r1);
id2 := Create(g( second part of L ), r2);

wait(id1);
wait(id2);

return [ op( r1), op( r2 )]:
end proc:

which one is faster? Is it really true that the second possibility (b) should be almost twice as fast (in real time) on a two-core-machine?

Thanks for your help.

 

Please Wait...