Cathey, Jim schrieb:
>> for i in file
>> do
>>  md5sum $i &
>> done
> 
> The trouble with this, and your proposed successor, is
> that they fork off N processes, whereas I want there to
> only be two working processes, one for each core we have.
> Any more than that represents a slowdown, not a speedup,
> for a CPU-intensive task like MD5, assuming the embedded
> system could even survive that number of forks.
> 
>> When you say "threaded" here, are you talking -lpthread?  Because you
> were 
>> talking about merely using fork before...
> 

IMHO the right way is to start thinking about a parallel algorithm using
the MP option of gcc. The example above has two potential bottlenecks
1. the read-from-media  2. calc md5
depending on your system you may have the one or other or both.

“Premature optimization is the root of all evil." (Donald Knuth)

just for my curiosity did you try to build your busybox -mtune=native ?

re,
 wh




_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to