From owner-freebsd-hackers Fri May 3 5: 0:41 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from host217-39-140-82.in-addr.btopenworld.com (host217-39-140-82.in-addr.btopenworld.com [217.39.140.82]) by hub.freebsd.org (Postfix) with ESMTP id DFB4537B404 for ; Fri, 3 May 2002 05:00:32 -0700 (PDT) Received: by host217-39-140-82.in-addr.btopenworld.com (Postfix, from userid 1001) id 6261812D; Fri, 3 May 2002 13:00:31 +0100 (BST) Date: Fri, 3 May 2002 13:00:31 +0100 From: Dominic Marks To: Paolo Di Francesco Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: A time resolution problem Message-ID: <20020503130031.A790@host217-39-140-82.in-addr.btope> References: <3CD29602.24230.34C2C21@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3CD29602.24230.34C2C21@localhost>; from paipai@tin.it on Fri, May 03, 2002 at 01:52:02PM +0200 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, May 03, 2002 at 01:52:02PM +0200, Paolo Di Francesco wrote: > Hello hackers, > > I am trying to write a simple C program that must do some > specialized things. The idea is that the program must send > packets each T seconds. Ok, I know.. use the sleep, microsleep > things, and it works pretty well if the interval is greater than > 1 msec. (recompiled the kernel with HZ=100000) > > Now the problem is that I want to know if it is possible, and > how, to schedule events with a precision greater (or equal to)) > than 1ms. Maybe an approach with posix timers? Maybe move the app > into the kernel space? Maybe change the scheduler? KEvent has EVFILT_TIMER to allow you to return after a period. It takes a struct timespec as its argument, which goes down to nanosecond resolution. If it is practically useful at such small intervals I do not know, but its possibly in theory. > any idea, even the most exotic ones, appreciated! > > -- > > Ciao Ciao > > _ > ->B<- All Recycled Bytes Message ... > ~ > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- Dominic To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message