LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

disadvantages of global variable

Hi,

 

I want to know what is the disadvantages of local variable and global variable

 

Regards

Ravi

0 Kudos
Message 1 of 4
(4,385 Views)

Search for the term "race condition".

0 Kudos
Message 2 of 4
(4,363 Views)

A Look At Race Conditions

 

In short, local and global variables are good for storing/reading the latest value of something.  This is called a Tag.  As long as you have just 1 writer to the tag, things work well.  The problem that most people run into is the mutliple writers to a tag race condtion and the using of a tag when a message (should be a Queue or User Event) or stream (likely a Queue) should have been used since you want to make sure all of messages and stream data are processed.

 

If you make it to NI Week, I will be presenting on this topic (still waiting for official notice).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(4,309 Views)
Hi, Thank u crossrulz.i understand it Regards Ravi
0 Kudos
Message 4 of 4
(4,213 Views)