If you have 1 and only 1 thread writing to the variable, then whether you have to protect it depends on the type of the variable. If the type is a type that the OS guarantees gets written in an atomic manner, you do not actually have to protect it. This, however, introduces some brittleness to your program that is probably not worth the time you save by not protecting the variable. If you update your program in the future to use more than 1 writing thread and/or you change the variable so that it no longer gets written atomically your program will break in some obscure and unreproducible manner.
If you do decide to protect the variable, the simplest thing to do is to use the CVI Utility library Thread Safe Variable macros. The documentation for these exists in th
e function panel class help for the Thread Safe Variable functions (Library>Utility>Multithreading>Thread Safe Variable).
For more information, see the Multithreading in LabWindows/CVI whitepaper (Start>Programs>National Instruments>Measurement Studio>Help>Measurement Studio Library>Concepts and Techniques LabWindows/CVI>Multithreading in LabWindows/CVI).
David Rohacek
National Instruments