01-07-2019 01:58 PM
I have a program where my main VI is starting multiple instances of a different VI asynchronously, and not waiting for the results. In this "different VI" there are many layers of sub-VI's. Do I need at have all sub-VI's start asynchronously as well? Or does simply starting the "different VI" asynchronously suffice?
I am worried that the multiple instances of the "different VI" will have to compete/wait for access to any of its sub-VI's.
Thanks in advance.
Solved! Go to Solution.
01-07-2019 02:21 PM
If the SubVIs are non-reentrant, then the instances of the "different VI" will have to do some waiting because each non-reentrant subVIs can only serve one caller at a time. However if the SubVIs are reentrant, clone instances of them can be called simultaneously by the instances of the "different VI".
01-07-2019 02:32 PM
That's what I suspected. Will there be any issues with re-entrant subVI's returning data to the wrong instance of the calling "different VI" ?
01-07-2019 02:38 PM
@Bolson785 wrote:
That's what I suspected. Will there be any issues with re-entrant subVI's returning data to the wrong instance of the calling "different VI" ?
No.
Ben
01-08-2019 06:53 AM
@Bolson785 wrote:
That's what I suspected. Will there be any issues with re-entrant subVI's returning data to the wrong instance of the calling "different VI" ?
No.
01-08-2019 08:49 AM
I bet you could create such a problem for yourself if the VI used some named queue and send it back so both calls picked out the answers from the queue but in wrong order ... but as you can see you basically would have to try deliberately.
/Y
01-08-2019 09:08 AM
@Yamaeda wrote:
I bet you could create such a problem for yourself if the VI used some named queue and send it back so both calls picked out the answers from the queue but in wrong order ... but as you can see you basically would have to try deliberately.
/Y
It was just last month that my boss wanted to introduce a named queue and I recoiled from the idea because of just that complication. Now if the name of the named queue is derived from the VI that created same, we side-step yet another disaster waiting to happen.
Ben
01-10-2019 01:20 AM
I can imagine it can happen, but I've never had it happen to me and I use named queues every so often. Then, it's rarely many queues and the systems are usually not very large.
As a side note that possibly will make you cringe, the garbage collection in G# is based on named queues. 😉 Objects are kept track of in queues named after the class, it's worked quite well for 8 years. 🙂
/Y