From owner-freebsd-current@FreeBSD.ORG Sat Oct 29 10:10:02 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97A7A16A41F; Sat, 29 Oct 2005 10:10:02 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8014E43D67; Sat, 29 Oct 2005 10:09:52 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id A653A46B13; Sat, 29 Oct 2005 06:09:51 -0400 (EDT) Date: Sat, 29 Oct 2005 11:09:51 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: "M. Warner Losh" In-Reply-To: <20051028.221825.90826015.imp@bsdimp.com> Message-ID: <20051029110825.B20147@fledge.watson.org> References: <35696.1130538037@critter.freebsd.dk> <20051029005719.I20147@fledge.watson.org> <4362CBC2.8050602@freebsd.org> <20051028.221825.90826015.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: pertti.kosunen@pp.nic.fi, phk@phk.freebsd.dk, davidxu@FreeBSD.org, jura@networks.ru, current@FreeBSD.org Subject: Re: Timers and timing, was: MySQL Performance 6.0rc1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2005 10:10:02 -0000 On Fri, 28 Oct 2005, M. Warner Losh wrote: > : thread libraries use clock_gettime, this becauses there is > : pthread_cond_timedwait and other synchronization objects > : like rwlock, and mutex all have a timeout version, I think > : pthread_cond_timedwait is mostly used in some applications, > : though normally, application is not looking for high accuracy. > : they will get benefit from the clock_gettime speed improvement. > > And unfortuantely, the argument that needs to be passed to abstime is > unspecified, at leas tin our man page. Also unfortuantely, > CLOCK_REALTIME seems to be what's required here (our man page just says > 'if the system time reaches the time specified in abstime'), rather than > CLOCK_MONOTONIC so jumps in system time can cause previously short > timeouts to become rather large timeouts... This is a flaw in the API. > :-( If the assumption is that these calls will behave like select() and poll(), then I would guess lowering the accuracy here would not be a problem, since it is widely understand that select() waits at timer tick granularity. Robert N M Watson