> 1) Could you elaborate on the statement "references [force] everything
> through the GUI thread?"  This kind of makes sense to me, but I
> haven't found much info on the web besides "using references for
> non-GUI stuff is not recommended."  I have personally noticed that
> sub-VI's that use refnums and property nodes do take more resources.
> 

There are several types of refnums.  File refnums refer to the contents 
of the file, and are sort of a pointer, but not to memory.  Control 
refnums on the otherhand are references to UI objects that happen to 
have Value as one of their many properties.  Note that value wasn't even 
there until LV6 I think.  Since they affect UI objects, they all 
serialize through the UI thread.  Reading a Boolean from its terminal or 
local happens in whatever thread is executing.  Doing any property on a 
UI object, including reading the value property switches to the UI 
thread and waits for it to do the job.  Of course if you have a VI that 
does lots of UI stuff, that makes sense, and in fact LV leaves the 
execution of the diagram in the UI thread to avoid the switching 
overhead so that your UI code migrates to the UI thread and your non-UI 
thread stays in the diagram thread -- nice.  When you mix UI and non-UI 
all over the place, you incur the switches.

> 3)  Re: OO
> 
> Having interfaces (abstract classes) would be nice, from a polymorphic
> point of view.  I know LabView has polymorphic VI's, but do
> polymorphic VI's distinguish between *different* cluster type def's?
> A more important problem is that you can't easily make an array of
> different (but related) type-def's.  That takes away a lot of the
> elegance of polymorphism.
> 

You are exactly right.  You mentioned in an earlier post that LV is 
touted as being object oriented.  Some people say that, but LV is 
lacking several object oriented elements, and the developers of LV do 
not refer to it as an object oriented language, at least not yet.

To do the three different pumps in an array, you can use an old school 
approach of a union, or you can look at the GOOP tools.  You can have a 
hierarchy of references and do either implicit or explicit casting to 
retrieve the true class type from the base.

Greg McKaskle


Reply via email to