LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I explicitly invoke an ancestor of a dynamic dispatch VI

The VIs must be re-entrant - some of our systems have dozens of instances of 'Child'; if they were not re-entrant the system would have a bottleneck in the the non-re-entrant VIs.

 

The example I provided is a simplification of the problem that I would resolve with overloading if it were available; it does not describe the requirements I was trying to solve. A simplification of the requirements is that given a class, enhance it to allow a client to (a) setValue, or (b) setValue and lock that value until done. A design constraint is that I am not allowed to change the given class.

0 Kudos
Message 21 of 24
(463 Views)

This may not be what you are after, but here goes anyway:

 

Have you considered using references to manage your locking/unlocking functionality.

It is in-built the the In-Place structure.

ref.png

 

There are many tricks, traps and limitations (References don't passively polymorph - You have to do geric/specific type conversion),

 

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 22 of 24
(451 Views)

Our team finished reviewing the example, and the code that it was based on. The resulting attached project (zip) is what we plan to go with for now, and the future (until LV comes out with overloading). The pattern is built up with two semaphores - one on the instance data manage the availability of the resource represented by the instance, and one 'on-the-wire' to indicate that if the instance semaphore is held, that it is OK to proceed because the semaphore is owned by the current thread of control.

 

This kind of semaphore pattern is known to us in other applications as a 'thread-safe' semaphore. This says that once the thread of control has entered into the instance and the instance has acquired a lock, that any method inside the instance can do what it wants with the instance until the lock is released.

0 Kudos
Message 23 of 24
(441 Views)

Here's the project.

0 Kudos
Message 24 of 24
(440 Views)