08-29-2024 04:45 AM
In am using LabVIEW 2023 Q3 32bit. In my project i am using a dvr to share a piece of data to many listeners. I usually update the data in one place but there are multiple readers, To my understanding the dvr ref is locked only while writing and not during reading. Also i enabled "allow parallel read only access" to avoid locking. But in my test the dvr is locked even during reading I also attached a vi to demonstrate the read locking behavior). Is the behavior as expected or my understanding is wrong with dvr.
Solved! Go to Solution.
08-29-2024 06:33 AM
Yes, the InPlace-structure works like a Mutex, so don't have any code in it that takes time (like a wait). Atleast to my understanding.
08-29-2024 06:36 AM
Thanks for your reply. NI documentation says the following.
You can enable read-only access to the data value reference by right-clicking the border node on the right of the structure and selecting Allow Parallel Read-only Access. When the border node on the right is unwired, LabVIEW allows multiple, concurrent read-only operations and does not modify the data value reference.
What does that mean 🤔
08-29-2024 07:16 AM
What you are seeing is that the long read is blocking the writing.
08-29-2024 07:24 AM - edited 08-29-2024 07:25 AM
08-29-2024 08:35 AM
@Samuel_James wrote:
Thanks for your reply. NI documentation says the following.
You can enable read-only access to the data value reference by right-clicking the border node on the right of the structure and selecting Allow Parallel Read-only Access. When the border node on the right is unwired, LabVIEW allows multiple, concurrent read-only operations and does not modify the data value reference.
What does that mean 🤔
If you have e.g. a big array of clusters which has large arrays the access can take some time, i think this allows parallell access in that case.
08-29-2024 09:40 AM
What crossrulz wrote is what is happening, but the mechanism is not obvious. Access is probably requested by a queue-like mechanism where parallel readers can just go ahead, but when a writer or regular reader is encountered, the queue will not be processed further until all current IPEs have finished execution. The access controller cannot guarantee that a reader is really fast and just let it skip the queue while the writer is waiting.
08-29-2024 09:57 AM - edited 08-29-2024 09:58 AM
08-29-2024 11:43 PM
I or everyone understands long reading is blocking the code. My point is that it should not block when it's in readonly mode. Thats what this thread is all about. Also that is wat ni documentation says.
08-30-2024 01:31 AM
The DVR is not blocked because of the long read. It is blocked by the writer requesting access.
When the fast reader requests access, it has to wait until after the writer's turn - which only gets access when the slow reader is done. I agree that this is not obvious and the documentation should point it out.