DEAR FRIEND,
I WANT TO USE GLOBAL VARIABLE AS A BINARY SEMAPHORE IN ONE MY RTOS PROGRAM. I KNOW IT IS POSSIBLE, BUT I DONOT KNOW THE LIMITATION WITH THIS TYPE OF USE. WHAT ARE THE LIMITATION (EXCLUDING FACILITY OF MUTEX SEMAPHORE) HERE.
Actually, "binary semaphore" and "mutex semaphore" are the same. As to implementation - it is the standard rule: you have to ensure atomic operations of test-modify for your semaphore if your system is pre-emptive. In others words, there should be no task switching during operation like "if (mutex==0) then mutex=1;".