From owner-freebsd-threads@FreeBSD.ORG Thu Dec 22 18:32:35 2011 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 476C5106566B; Thu, 22 Dec 2011 18:32:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1CC078FC08; Thu, 22 Dec 2011 18:32:35 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id C112646B06; Thu, 22 Dec 2011 13:32:34 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 56ABEB91E; Thu, 22 Dec 2011 13:32:34 -0500 (EST) From: John Baldwin To: freebsd-threads@freebsd.org Date: Thu, 22 Dec 2011 13:31:10 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <4EF059DC.26433.B55D8036@s_sourceforge.nedprod.com> <201112211854.40798.hselasky@c2i.net> <86vcp8sfld.fsf@ds4.des.no> In-Reply-To: <86vcp8sfld.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201112221331.11031.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 22 Dec 2011 13:32:34 -0500 (EST) Cc: arch@freebsd.org, Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= , threads@freebsd.org, Hans Petter Selasky Subject: Re: [Patch] C1X threading support X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2011 18:32:35 -0000 On Thursday, December 22, 2011 12:04:14 pm Dag-Erling Sm=C3=B8rgrav wrote: > Hans Petter Selasky writes: > > Absolute timeouts is no good idea! We should stick with kernel-ticks wh= en=20 > > possible :-) >=20 > There is no such thing as a kernel in the C standard. All it knows > about is the implementation and the program. The best solution would > probably have been a timescale that counts the time elapsed since the > start of the program. You could do relative timeouts specified in some absolute timescale like us= or=20 ns or ms. You could even use a 'struct timespec' or some such to do that=20 similar to how the it_interval member of struct itimer is used with=20 setitimer(2). That is what programmers actually want to use, and invariabl= y=20 end up implementing in a wrapper API around APIs that use absolute timeouts. =2D-=20 John Baldwin