Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/06/2010 in all areas

  1. That happens when the scope of the palette vis does not allow the active vi window to use them. If you open a vi that does have scope to use them, the x's will go away.
    1 point
  2. I agree with everything previously said in this thread, so let me add something a little different. You are asking the wrong question. Instead of "how do I access the same object in parallel loops," you need to ask "how do I want this class to behave?" Broadly speaking, there are three possibilities: By-val. Each new instance creates a new object. Branches create a copy of the object. (This is the "normal" way.) By-ref. Each new instance creates a new object. Branches refer to the same object. Singleton. All instances and branches refer to the same object. (You can create classes in which some data is by-val, some is by-ref, and some is singleton, but that's beyond the scope of this post.) By first defining the expected behavior for the class as a whole, you can build that functionality into the class itself in a way that doesn't break your application in other areas. If the class' built-in behavior doesn't fit your requirements at a certain point in the code, you add other code at the application level to fit the behavior you need there. Suppose your program will have lots of instances of a class, so you decide it should be by-val to simplify the programming. But in this one place you need by-ref behavior so you can access the object from parallel loops. That's where you would use the DVR or other techniques to enable that functionality. On the other hand, if it makes sense for the class itself to be by-ref, you can build that into the class members in a way that class users don't have to worry about DVR's, IPE's, queues, FG's, etc. The class user just needs to know that it's a by-ref object, and branches don't create copies. [Edit - Changing an object's behavior can only be done in a single direction. (By-val -> By-ref -> Singleton) You can make a by-val object behave like a singleton, but you can't make a singleton behave like a by-val object.]
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.