>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...

No, just pure fork.  No need for pthreads, the only passed-back
information is a success/fail status code, which exit() can handle
just fine.

I tend to use "threaded" in its more generic sense, since I
spent a lot of time coding that kind of stuff on a platform
that didn't have any sort of what we now call threads.  (It
had fabulous asynchronous I/O, though.  All of stat, open, creat,
close, read, write, ioctl, wait, nap, were optionally asynchronous.
All network activity utilized only the above calls, too.)  The
most effective coding style was event-driven, with multiple
threads of activity going on in parallel.

-- Jim




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

Reply via email to