From mboxrd@z Thu Jan 1 00:00:00 1970 From: Urs Thuermann Subject: Keeping all CPUs busy Date: 13 Aug 2003 21:17:39 +0200 Sender: linux-smp-owner@vger.kernel.org Message-ID: Mime-Version: 1.0 Return-path: List-Id: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-smp@vger.kernel.org I sometimes run many CPU-intensive processes in a loop like this for f in *; do lame -h $f ${f/wav/mp3}; done However, this will run only one process at a time. Executing all processes in the background would execute them all at the same time. Is there an easy way to run n processes at time, when you have n CPUs? On could of course write an Makefile and run make -j2, but I'd like to know I there is a simpler way without Makefile or something like that. urs