Mail Archives: djgpp/1999/04/25/06:22:00
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 -