Justin Zygmont <[EMAIL PROTECTED]> wrote: > to make use of it i'm not so clear on. I think more examples and > explanation of different threading senarios would help. for example, if I > had a shell script that had to gzip 20 files, what would be the right way, > fork > out 20 instances to gzip from a loop, recompile gzip to use threads?, and > what part the OS would do. Nothing i've ever read would say that a > process is limited to 6.25% of the CPU usage for a 4 core T1 (100 / 16) > thats what top shows.
I use the following to shrink and auto-rotate camera images: c=0 for i in "$@"; do n=`basename $i` cp -pi $i . chmod +w $n or=`exiftool $n | grep Orientation` rot=0 echo $or | grep "90 CCW" && rot='-90' echo $or | grep "90 CW" && rot='+90' echo $n $rot if [ $rot = 0 ]; then mogrify -rotate $rot -resize 1280x851 -format jpg -quality 100 $n & else mogrify -rotate $rot -resize 682x1024 -format jpg -quality 100 $n & fi echo c: $c c=`expr $c + 1 ` echo $c if [ `expr $c % 4` = 0 ]; then wait fi done I run it on a 4 way Opteron and as I usually have hundreds of images, it works nicely... This is not the optimum as it asumes that each "mogrify" call takes the same time. I would like to see support for this kind of scripts in a shell. This could be done by allowing to wait for the next finished job and then starting one new job. Jörg -- EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin [EMAIL PROTECTED] (uni) [EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily _______________________________________________ opensolaris-discuss mailing list opensolaris-discuss@opensolaris.org