Avoiding Race Conditions
A race condition occurs when two or more pieces of code that execute in parallel change the value of the same shared resource. Because the outcome of the VI depends on which action executes on the shared resource first, race conditions cause unpredictability. Often, race conditions occur with the use of local and global variables or an external file, although race conditions can exist any time more than one action updates the value of the same stored data. The following block diagram shows an example of a race condition with a local variable.
请参考 http://zone.ni.com/reference/en- ... to/race_conditions/