Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Dec 2011 13:31:10 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-threads@freebsd.org
Cc:        arch@freebsd.org, Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= <des@des.no>, threads@freebsd.org, Hans Petter Selasky <hselasky@c2i.net>
Subject:   Re: [Patch] C1X threading support
Message-ID:  <201112221331.11031.jhb@freebsd.org>
In-Reply-To: <86vcp8sfld.fsf@ds4.des.no>
References:  <4EF059DC.26433.B55D8036@s_sourceforge.nedprod.com> <201112211854.40798.hselasky@c2i.net> <86vcp8sfld.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, December 22, 2011 12:04:14 pm Dag-Erling Sm=C3=B8rgrav wrote:
> Hans Petter Selasky <hselasky@c2i.net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112221331.11031.jhb>