Mail Archives: djgpp/1999/04/27/11:10:17
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 -