02-21-2006 03:09 PM
I would like to create an ad-hoc weather station program (I'll explain more in a bit). I am using LabVIEW 8.0 Full Edition, and I would like to share data over a network between stations with the LabVIEW Shared Variable. Here's what I want to be able to do:
I am trying to enumerate problems with this before implementing, and I have run into a stinker of a problem that I am not sure how to solve. How do I synchronize accesses to the LabVIEW Shared Variable? If I read the variable, modify it, and write it back, I will undoubtedly run into a race condition where 2 nodes attempt to update its data and I will lose the data written by the first node - Node A reads, Node A modifies, Node B reads, Node A writes, Node B Modifies, Node B Writes, and thus the modifications made by Node A are lost. In my specific application losing some data isn't critical, but if not remedied this type of problem could cause massive amounts of data to be lost when there are numerous nodes, and that is definitely not acceptable.
Does anyone have any recommendations on how to synchronize the read-modify-write operations on the data in the Shared Variable?
-Danny
02-23-2006 02:01 AM
02-23-2006 02:43 AM - edited 02-23-2006 02:43 AM
Message Edited by texasdiaz on 02-23-2006 02:52 AM
02-23-2006 08:10 AM
Yes Danny, that is a big short-coming in the Shared Variable and it inherited that issue from the traditional global.
If you have not seen it yet, you may want to review post #2 in this thread
http://forums.lavausergroup.org/index.php?showtopic=2548
on the LAVA forum for general info on the shared variable.
There should be ways of implementing what you are after but that solution would be in the architecture and not in the global.
If anyone has this figured out already, I love to hear your thoughts!
Ben