Daklu Posted May 31, 2011 Report Share Posted May 31, 2011 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? Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 31, 2011 Report Share Posted May 31, 2011 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 1 Quote Link to comment
Daklu Posted June 3, 2011 Author Report Share Posted June 3, 2011 Thanks Ben. I hadn't considered copy on write, but that makes a lot more sense than either of the two options I posted. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.