I am wondering how I can determine which operations I can assume to be atomic. I am unsure of the role the compiler (TI 7.4.5), architecture (C6657), and OS (SYS/BIOS). Assuming I am working on a C++ project, when would I use constructs of the C++ language vs instrinsics vs OS constructs.
A simple example might be assignment to an int.
class Foo
{
public:
void far();
int myX;
};
void Foo::bar()
{
myX = 3; // how can I make this atomic?
}
I believe I understand how _disable_interrupts and _restore_interrupts intrinsics could be used for arbitrary code blocks, but are there occasions when these are not necessary, or some other mechanism may be a better option? Which documents might help me determine this?