From owner-freebsd-drivers@FreeBSD.ORG Mon Oct 20 17:40:51 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890721065671 for ; Mon, 20 Oct 2008 17:40:51 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 78A798FC14 for ; Mon, 20 Oct 2008 17:40:51 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 60B9B1A3C37; Mon, 20 Oct 2008 10:40:51 -0700 (PDT) Date: Mon, 20 Oct 2008 10:40:51 -0700 From: Alfred Perlstein To: Len Gross Message-ID: <20081020174051.GM22503@elvis.mu.org> References: <27cb3ada0810190720u2cc84097w2ed6425bc6ee8d3f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27cb3ada0810190720u2cc84097w2ed6425bc6ee8d3f@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-drivers@freebsd.org Subject: Re: Polling and Sleep in a Driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:40:51 -0000 * Len Gross [081019 07:49] wrote: > I have a MAC protocol written using Netgraph. It runs in userland > and uses a simple poll, sleep loop. It has proved that the algorithms > are correct, but the sleeps are not regular/accurate enough for my > purposes. (I have pushed Hz up quite a bit with no real effect) > > If I were to implement the algorithms within a driver would the sleeps > still suffer from the same "non real-time" behaviour I see in > userland? > > Thanks in advance. Try hooking hardclock(), just be careful. -Alfred