From owner-freebsd-current@FreeBSD.ORG Mon Feb 5 04:17:06 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2CEBD16A400 for ; Mon, 5 Feb 2007 04:17:06 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.freebsd.org (Postfix) with ESMTP id ED97313C467 for ; Mon, 5 Feb 2007 04:17:05 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (4gnt7ixt1oa8d6eg@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id l153dPeM003342; Sun, 4 Feb 2007 19:39:25 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id l153dPna003341; Sun, 4 Feb 2007 19:39:25 -0800 (PST) (envelope-from jmg) Date: Sun, 4 Feb 2007 19:39:25 -0800 From: John-Mark Gurney To: lu ping Message-ID: <20070205033925.GA1620@funkthat.com> Mail-Followup-To: lu ping , freebsd-current@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-current@freebsd.org Subject: Re: sleep in freebsd kernel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 04:17:06 -0000 lu ping wrote this message on Sat, Feb 03, 2007 at 16:28 -0500: > I have a question about making my kernel thread sleep for a while. I think I > can use "tsleep", but the timeout for this call is only counted as system > ticks (usually at millisecond granularity). However I want to make my > "sleep" return in microsecond granularity. Does anybody know how to realize > this? Take a look at DELAY(9)... This busy waits instead of sleeping... FreeBSD currently doesn't have a method to make a kernel thread sleep for sub-hz granularity... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."