Quote:
Originally Posted by Greg McKaskle
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