View Single Post
  #5   Spotlight this post!  
Unread 10-08-2012, 08:47
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)

Quote:
Originally Posted by Greg McKaskle View Post
Also, can you give more detail on why you don't need a mutex? From your description I can see folks writing a read/modify/write piece of code with no mutex,
Yeah, I saw that too but forgot to comment about it.

Asserting a bit in a word is not an atomic operation. You have to read the word, or it with a mask, and write it back. You could get interrupted in the middle of the sequence.

Since memory is not an issue (for FRC), instead of flipping bits you could use an array of words*. Then there'd be no contention among the threads.


* the length of which is whatever is atomic for the processor and most efficiently handled by it



Last edited by Ether : 10-08-2012 at 09:06.