delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/27/11:10:17

From: XXguille AT XXiies DOT XXes (Guillermo Rodriguez Garcia)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: More questions on uclock
Date: Sun, 25 Apr 1999 23:42:24 GMT
Organization: Telefonica Transmision de Datos
Message-ID: <3723a79b.1763260@noticias.iies.es>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990425120025 DOT 9117f-100000 AT is>
NNTP-Posting-Host: 194.224.30.221
Mime-Version: 1.0
X-Newsreader: Forte Agent 1.5/32.451
Lines: 33
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

El día Sun, 25 Apr 1999 12:00:51 +0300 (IDT), Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> escribió:

>> 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.

OK, I understand.

>
>> 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.

I don't have the sources, and I thought that since they both give high
resolution (about 1 us) they might use the same hardware resources and
maybe some common infrastructure ...

Thanks for your help!

Regards,
GUILLE
----
Guillermo Rodriguez Garcia
XXguille AT XXiies DOT XXes (ya sabes :-)

- Raw text -


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