Jump to content

Sanity check on globals...


Recommended Posts

I've been refactoring some prototype code that uses globals extensively. Consider the following situation...

One loop writes to the global infrequently in response to a front panel event. A parallel loop reads from the global on every iteration. My understanding is that LV creates a copy of the data in a global every time it is read (eager copying) rather than waiting to for someone else to attempt to change the global while the data is in use (lazy copying) before making a copy. Eager copying makes more sense for LV's primary market, but I've kind of been talking myself out of it.

Can anyone confirm?

Link to comment

I've been refactoring some prototype code that uses globals extensively. Consider the following situation...

One loop writes to the global infrequently in response to a front panel event. A parallel loop reads from the global on every iteration. My understanding is that LV creates a copy of the data in a global every time it is read (eager copying) rather than waiting to for someone else to attempt to change the global while the data is in use (lazy copying) before making a copy. Eager copying makes more sense for LV's primary market, but I've kind of been talking myself out of it.

Can anyone confirm?

as I understand them...

For any single global...

LV does a copy to all instances of the read when writing to any write local. 20 read locals means copy the dat 20 times bfore the write is done.

Ben

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.