03-28-2013 01:54 AM
Hello,
Assuming that there are two threads, using a thread safe variable as a signal condition. When the 1st thread calling the GetPointerToVarName() to do something, at the "same time", the 2nd thread need to call GetPointerToVarName() to modify something, I'd like to know if the 2nd thread can continue the work until the 1st thread call the ReleasePointerToVarName()?
David
03-28-2013 03:01 AM - edited 03-28-2013 03:03 AM
Thread safe variables can only be accessed by one thread at a time, so while the first one is holding the pointer, the second one waits until the pointer is released.
This is more rigid than using thread locks, in that a thread could call CmtTryToGetLock remaining free to run even if the lock cannot be acquired (supposing running without the locked object makes sense).
But it is not clear to me from your question whether you actually want thread safe variable functions to lock or are afraid they will do so...
03-28-2013 03:14 AM
Hi Roberto,
Due to just come back from Linux programming to cvi, some thread process method have confused me. Thank you for your replay.
David