|
Re: Robot/Dashboard communication and the FMS
I was asking for several reasons. From the manual ... "If you use this VI to obtain multiple references to the same named semaphore, each reference number is unique. "
So it is saying that each obtain should be balanced with a close. If it isn't, you wind up with quite a few refnums in short order.
I also ask, because the semaphore is often not the right tool for the job. They are a rather dangerous way to protect compared to the critical section that is built into every subVI. So the recommended way to protect a global is simply to wrap it in a function that is not reentrant. This critical section is considerably safer as it cannot be mismatched. The semaphore is only needed when the acquire and release are far removed from each other.
Greg McKaskle
|