12-13-2013 04:52 AM
I've got two parallel asynchronous loops. One reads images and writes to an image variable (either monochrome or colour U8). The other reads the image variable and processes it periodically.
Do I need to take precautions to avoid reading and writing simultaneously? And if so, what might be a good way to do this?
Thanks
12-13-2013 06:17 AM
12-13-2013 07:18 AM
I agree. I wanted to check whether the image variable type (as it's call-by-reference) had specific protection built-in within LabView to prevent simultaneous reading and writing. E.g. does whichever operation starts first lock it until completed?
I'm reading from a camera in one loop, and processing asynchronously in another.
I've written in a semaphore system (using local variables though), but maybe don't need it. Less complexity is better.
12-17-2013 12:51 AM
12-17-2013 03:24 AM
Thanks - that's useful. I was periodically getting "... is not an image" or "... is not the right size ..." errors, and 2 force quits of LabView, which made me wonder if it was possible to do bad things at the system level by reading and writing simultaneously. I've not got to the bottom of why it was happening yet in my code, but I think that switching to a functional global for the first part of the image copy / processing makes sense anyway and that may fix it.