From 6962d7c9a69d1221ce1ce37a30d2dde8d4c412b9 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 31 Mar 2019 16:11:04 +0300 Subject: [PATCH] added cpu core counting... Signed-off-by: Alex A. Naanou --- scripts/process-archive.sh | 9 +++++++-- ui (gen4)/archive/media/img/my/work/process-archive.sh | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/process-archive.sh b/scripts/process-archive.sh index 12ba1b5a..21486755 100755 --- a/scripts/process-archive.sh +++ b/scripts/process-archive.sh @@ -1,7 +1,12 @@ #!/bin/bash -# XXX get this from /proc/cpuinfo... -THREADS=6 +# SPU threads to keep free... +KEEP_FREE=2 + +THREADS=`cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l` +if [ $KEEP_FREE ] ; then + THREADS=$((THREADS - KEEP_FREE)) +fi # TODO make this runnable from anywhere... # - prepend paths with './' only if local/relative diff --git a/ui (gen4)/archive/media/img/my/work/process-archive.sh b/ui (gen4)/archive/media/img/my/work/process-archive.sh index 12ba1b5a..21486755 100755 --- a/ui (gen4)/archive/media/img/my/work/process-archive.sh +++ b/ui (gen4)/archive/media/img/my/work/process-archive.sh @@ -1,7 +1,12 @@ #!/bin/bash -# XXX get this from /proc/cpuinfo... -THREADS=6 +# SPU threads to keep free... +KEEP_FREE=2 + +THREADS=`cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l` +if [ $KEEP_FREE ] ; then + THREADS=$((THREADS - KEEP_FREE)) +fi # TODO make this runnable from anywhere... # - prepend paths with './' only if local/relative