From owner-freebsd-hackers Fri May 3 7:38:50 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from sirius.pc.cis.udel.edu (sirius.pc.cis.udel.edu [128.4.133.24]) by hub.freebsd.org (Postfix) with ESMTP id 1756437B41B for ; Fri, 3 May 2002 07:38:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sirius.pc.cis.udel.edu (8.11.3/8.11.3) with ESMTP id g43Ecmc01446; Fri, 3 May 2002 10:38:48 -0400 (EDT) (envelope-from jain@sirius.pc.cis.udel.edu) Date: Fri, 3 May 2002 10:38:48 -0400 (EDT) From: Manish Jain To: Paolo Di Francesco Cc: Subject: Re: A time resolution problem In-Reply-To: <3CD29602.24230.34C2C21@localhost> Message-ID: <20020503103757.A1439-100000@sirius.pc.cis.udel.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 hi, one possible solution could be to use gettimeofday (usec resolution ) and do a busy wait in a loop for T sec. manish http://www.cis.udel.edu/~jain On Fri, 3 May 2002, 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? > > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message