im trying to figure this out and Im having problems getting it to not go into an infinite loop. The exchange function is actually implementing mutual exclusion for there different functions. This work when i use the "atomic" keyword on the Exchange function. I am not asking for the answer. Just a direction. thanks
Im actually doing this in a BACI environment using C--. Im still stuck. I cannot get mutual exclusion for Exchange(). Again, Exchange() is implementing mutex for three separate functions. However, it itself needs mutual exclusion. Im trying to get there using a testAndSet function that has interrupts disabled(ie atomic). But for some reason the lock never opens and all functions get stuck in a deadlock. Again, not asking for the answer, just some direction, conceptually for the mutex testAndSet construct.
Sorry to say this, but I don't think you'll get much help with this. (Actually I might be wrong.)
I'm not saying you certainly wont get help, but these forums specialize in C/C++, sometimes Java, sometimes C# and scripting languages. I don't think C-- is a largely known to these forums. Is there some sort of C-- forum?