Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Of course all recent versions of LV have global variables, accessed from the structures palette, so why do people still refer to them or even use them?

0
Posted

Of course all recent versions of LV have global variables, accessed from the structures palette, so why do people still refer to them or even use them?

0

1. More efficient memory storage. Beacuse the vi retains the same data space regardless of it use in the code, only a single call to the memory manager is made. If arrays are stored in the USR, and replace array element primitives used, then the memory space is efficiently used/accessed wherever the vi is called. 2. Built in data space protection. One problem that can happen with normal globals in LV, occurs if you try to write a value to the global in several places in your code, updates to the value are unpredictable with respect to time. This means that changes to the global can be subject to race conditions. This is especially true if you read/write to the global where a race condition could occur between the read and the write of the variable.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123