Date: Sun, 25 Apr 1999 12:00:51 +0300 (IDT) From: Eli Zaretskii 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.