george seifert Posted October 12, 2009 Report Share Posted October 12, 2009 Sorry, I'm sure this is covered somewhere, but a quick search didn't find it. I need to send data from one loop to another. I'm going to generate a user event so the second loop can use a dynamic event to respond to the incoming data. Is it better to send the actual data (which consists of a few clusters with about 10 components in them) or references to the clusters? George Quote Link to comment
Grampa_of_Oliva_n_Eden Posted October 12, 2009 Report Share Posted October 12, 2009 Sorry, I'm sure this is covered somewhere, but a quick search didn't find it. I need to send data from one loop to another. I'm going to generate a user event so the second loop can use a dynamic event to respond to the incoming data. Is it better to send the actual data (which consists of a few clusters with about 10 components in them) or references to the clusters? George If by "references" you are refering to control references, then pass the data. Ben Quote Link to comment
george seifert Posted October 12, 2009 Author Report Share Posted October 12, 2009 If by "references" you are refering to control references, then pass the data. Ben Yes, I meant the control references. And thanks. George Quote Link to comment
Grampa_of_Oliva_n_Eden Posted October 12, 2009 Report Share Posted October 12, 2009 Yes, I meant the control references. And thanks. George With that clarified then I'll proceed wi the "Why". 1) At least one data copy is required when using a property node. 2) Property nodes execute in the UI thread, so the code has to be switched to another thread and wiat for its turn to run in that thread. Ben Quote Link to comment
PaulG. Posted October 12, 2009 Report Share Posted October 12, 2009 Sorry, I'm sure this is covered somewhere, but a quick search didn't find it. I need to send data from one loop to another. I'm going to generate a user event so the second loop can use a dynamic event to respond to the incoming data. Is it better to send the actual data (which consists of a few clusters with about 10 components in them) or references to the clusters? George Just out of curiousity, but why would you think about sending references to the clusters instead of the actual data itself? It just seems kind of complicated to send the references. Quote Link to comment
crelf Posted October 12, 2009 Report Share Posted October 12, 2009 Just out of curiousity, but why would you think about sending references to the clusters instead of the actual data itself? It just seems kind of complicated to send the references. Sending the reference could give you more control - you could send different references at different times. Also, you might want to manipulate more than the data (properties for example). But I agree with PaulG. - if it's always the same cluster and you only want to work on the data, then just send the data. Quote Link to comment
george seifert Posted October 12, 2009 Author Report Share Posted October 12, 2009 Just out of curiousity, but why would you think about sending references to the clusters instead of the actual data itself? It just seems kind of complicated to send the references. I'm not sure why you say it would more complicated to send the references. Just right click on the cluster to create a reference and send that. It seemed a little cleaner. I wasn't sure which way would be faster, create fewer data copies, etc. George Quote Link to comment
ShaunR Posted October 12, 2009 Report Share Posted October 12, 2009 I'm not sure why you say it would more complicated to send the references. Just right click on the cluster to create a reference and send that. It seemed a little cleaner. I wasn't sure which way would be faster, create fewer data copies, etc. George Mot much in it really. Labview nowadays creates copies of things if there is a Y in the day and you've just exhaled. The main advantage of data over refs is that data is much easier to debug since you can probe it directly to see the data. Quote Link to comment
Mark Yedinak Posted October 12, 2009 Report Share Posted October 12, 2009 I'm not sure why you say it would more complicated to send the references. Just right click on the cluster to create a reference and send that. It seemed a little cleaner. I wasn't sure which way would be faster, create fewer data copies, etc. George The primary benefit of passing the data directly as opposed to using references is that you avoid race conditions. Once you pass the data via a reference you introduce the possibility of race conditions in your application. They can be very difficult to track down and debug. 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.