From owner-freebsd-hackers Tue Sep 9 12:58:16 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA01573 for hackers-outgoing; Tue, 9 Sep 1997 12:58:16 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id MAA01550 for ; Tue, 9 Sep 1997 12:58:08 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id UAA19872; Tue, 9 Sep 1997 20:47:13 +0200 From: Luigi Rizzo Message-Id: <199709091847.UAA19872@labinfo.iet.unipi.it> Subject: Re: Realtime Programming Under FreeBSD? To: jamil@counterintelligence.ml.org (Jamil J. Weatherbee) Date: Tue, 9 Sep 1997 20:47:13 +0200 (MET DST) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: from "Jamil J. Weatherbee" at Sep 9, 97 11:43:51 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Can someone give a code snippet of the BEST way of running a 1000HZ for > loop under freebsd, without consuming massive amounts of cpu time. one way I can think of is to build a kernel with HZ=1000 (or higher). Make your process run at high priority, wake up at every tick (through setitimer or usleep etc.) do its task and go back to sleep. Cheers Luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________