Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: mogul@actitis.pa.dec.com (Jeffrey Mogul)
Subject: Re: Real time clock (rpcc)
Date: 1997/06/26	[thread overview]
Message-ID: <5ose30$iu5@usenet.pa.dec.com> (raw)
In-Reply-To: nK9t0CA9VVszEwhs@RK-COMP.DEMON.CO.UK


In article <nK9t0CA9VVszEwhs@RK-COMP.DEMON.CO.UK>, Rob Kirkbride <rk-comp@rk-comp.demon.co.uk> writes:
|> I am trying to use rpcc to give me accurate times in order that I can
|> trigger a timer every 50ms. This generates a SIGALRM and then I use the
|> rpcc instruction to find whether I have am late servicing the timer and
|> if so by how much.
|> 
|> Also my code
|> is not safe in a multi-processor system which I would like it to be.

If you can tolerate a few microseconds of overhead, and if you are
running Digital UNIX V4.0 or later, you can configure the kernel
to provide microsecond resolution from the gettimeofday() system
call.

The kernel does this by using the RPCC instruction to interpolate
between the 1024 Hz clock interrupts.  As you observe, this can
be tricky on a multiprocessor.  However, my understanding is that
the kernel code solves this problem, using a fairly subtle algorithm
to make sure that the interpolation is done correctly.  It might
be very hard (or even impossible) to do this efficiently inside
user-level code.

For more details, see
	http://www.supelec.fr/decus/faq/faq-Digital-UNIX.html#P9

-Jeff



  reply	other threads:[~1997-06-26  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-25  4:00 Real time clock (rpcc) Rob Kirkbride
1997-06-26  4:00 ` Jeffrey Mogul [this message]
1997-06-27  4:00   ` Rob Kirkbride
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox