> But the subVI is not realy a subVI but a VI running in parallel.
> My problem is to share a big array between 2 parallel VI with real time
> constraints.
> So I can't use global variable which are too slow.
> Both VI are loaded at the same time and use notification to communicate
> together. (Front panel of the second isn't visible)
> The big array is build in the first VI and use by the seconds after
> notification.
> If the first VI sends the array to te second using "Set control" method,
> data are dupplicated and I loose too much memory.
> Perhaps can I developp a DLL to manage the shared array.
> But is there a good method in LV to properly share the same array between VI
> with my constraints.
>
The long version of the response is in private email, because I read it first
and don't want to type it again. The short version of the response is ...
LV2 style globals. Functional globals that use a shift register to store
the information and an Operation input along with several other parameters
to select data to be returned. This speeds up execution when only a subset
of the global needs to be accessed, and it therefore reduces the memory being
used to what is needed. The most important usage, though, is to eliminate
race conditions, where both loops are trying to read, modify, write to the
global in parallel. By making each of these into a read left shift register,
modify the value, write to the right shift register, that is located
inside of
a non-reentrant VI, you protect that operation from interruption from another
operation on the same storage. I believe that the examples still
explain how
to make and use these functional globals.
If you do the same thing in a DLL, you will have slightly less overhead
per call,
but it will be more difficult to write. It should use the same amount
of memory,
and don't forget to make it non-reentrant or use a mutex or critical
section to
protect parallel accesses or you are just moving the race condition from the
diagram to the DLL.
Greg McKaskle