View Single Post
  #6   Spotlight this post!  
Unread 10-08-2012, 18:22
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: runtime thread execution monitoring (identify cause of hung code)


How about using a counter instead of a flag?

Code:
* start thread *
push_flags();
disable_interrupts();
threadID++;
pop_flags();
* put thread code here *
* end thread *
Monitoring thread reads and resets (zeros) counters. Keeps track of when each counter was last reset. Uses counter value and elapsed time (since last reset) to monitor thread health.