delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/25/06:22:00

Date: Sun, 25 Apr 1999 12:00:51 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: More questions on uclock
In-Reply-To: <371efc8a.115181@noticias.iies.es>
Message-ID: <Pine.SUN.3.91.990425120025.9117f-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 22 Apr 1999, Guillermo Rodriguez Garcia wrote:

> Some more questions related to uclock( ):
> 
> 1. Is this function 'reentrant'? That is, can I use it safely in an
> interrupt handler AND in the main program?

Yes, `uclock' is reentrant, since it doesn't maintain any static data
of its own.  However, if the interrupt handler is invoked frequently,
it might effectively lower `uclock's resolution, since if `uclock' is
interrupted when it fetches the timer counter, it will get
inconsistent results, and would then wait some more until it gets
consistent results.

> 2. Can I use usleep in the main program if I am using uclock in the
> interrupt handler?

Yes.  `usleep' doesn't call `uclock' at all, btw, so I'm puzzled why
did you think there should be any connection.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019