From owner-freebsd-stable Fri Nov 16 12:21:33 2001 Delivered-To: freebsd-stable@freebsd.org Received: from io.dreamscape.com (io.dreamscape.com [206.64.128.6]) by hub.freebsd.org (Postfix) with ESMTP id AEDD137B416 for ; Fri, 16 Nov 2001 12:21:30 -0800 (PST) Received: from mwmicro (uA9-p15.dreamscape.com [209.217.200.142]) by io.dreamscape.com (8.9.3+blt/8.9.3) with SMTP id PAA04031 for ; Fri, 16 Nov 2001 15:16:47 -0500 (EST) From: "Dennis Mathiasen" To: Subject: RE: compiling /bin/sh with builtin 'test' Date: Fri, 16 Nov 2001 15:21:30 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal In-Reply-To: <20011117012056.A320@grosbein.pp.ru> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Friday, November 16, 2001 1:21 PM, Eugene Grosbein Wrote: > I have a production router that is 4.0-SNAP-somedate installed on old > 486SX-25/8M RAM/200M HDD machine. This snapshot is stable for the task > of routing/shaping and my router works about a year. [ snip ] > Now I need to implement some extra tasks using this machine and write > some shell scripts using /bin/sh. There are loops in these scripts > and these loops run too slow becouse it is slow to fork+exec to > execute 'test' (it needs to swap) on this hardware. Why not just write it in C instead? I have a 386 DX with an 8087 at 20 MHz 8M Ram 600M HD running 2.2.8 with a stripped down kernel in service for two years as a router. When I tried to run a couple of complex shell scripts on it to gather some usage statistics, it seemed to bog down too much, but I didn't give it much of a test. I re-wrote it in C. Shared memory and signals with some always active processes solved the problem nicely. I can't detect any performance difference at all. Dennis Mathiasen dennislm@dreamscape.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message