Path: utzoo!attcan!uunet!dino!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!jb10320 From: jb10320@uxa.cso.uiuc.edu (Jawaid Bazyar) Newsgroups: comp.sys.apple Subject: Heartbeat Blues Message-ID: <1989Nov29.075626.21500@ux1.cso.uiuc.edu> Date: 29 Nov 89 07:56:26 GMT References: <1101@mountn.dec.com> <1152@umigw.MIAMI.EDU> <3879@puff.cs.wisc.edu> <1161@umigw.MIAMI.EDU> <36850@apple.Apple.COM> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: jb10320@uxa.cso.uiuc.edu (Jawaid Bazyar) Organization: University of Illinois at Urbana-Champaign Lines: 39 I hope someone out there can help me as I've been banging my head for about a week with this one. I wrote a routine to pause X number of tenths of seconds, it's called Pause() and it's included in a user tool set. Pause() calls some Heartbeat Interrupt handlers I wrote and here is where the trouble starts. Pause first calls AddTimer, which creates a new "timer" by giving it the amount of time to pause. A routine "DoTimer" is inserted in the Heartbeat Queue, and is activated every 6 ticks (1/10th second). DoTimer runs through the list of timers and decrements each active count. For example, if I called Pause(30), AddTimer would create a new timer with a count of 30. After the 30 ticks are up, the timer remains at zero. Pause sits in a loop calling CheckTimer, which returns the current count for a timer. Pause loops until its timer is 0, after which it simply returns. When I call Pause from my program it hangs. It's not the tool interface- it's been thoroughly tested from both assembly and a small C program. In these cases my routine works. It is only in my large project program that Pause does not work. And even stranger, Pause WORKS in my project program if I'm tracing the code with the Cortland Debugger. The system seems to die terribly when Pause is called- using Guy Rice's Interrupt Detector CDA I've determined that all interrupts cease when Pause is called (again, it works from debug/trace). If it's important the tool code is physically linked to the program. I've not had a problem with the other several tools I've written and hooked in this way. Is there something strange about the Heartbeat Queue that I'm overlooking? Why does my code work when being traced, but not when executed directly? Thanx for any help anyone can give me. Source available upon request. -- =============================================================================== jawaid bazyar jb10320@uxa.cso.uiuc.edu Junior/Computer Engineering UIUC Beneath the noble birth, between the proudest words, behind the beauty, Cracks appear Once, with hands held high, they sang out to the sky Why do their shadows bow in fear?