Jump to content

Single Storage point for Multithreaded code


Recommended Posts

Hi. I have a vi I am calling time and time again. Sometimes I call the VI its self and sometimes I call a VI which loads a clone instance by reference of the vi.

I need a single storage point for this vi, no matter where it is, how maybe threads deep it has got its self, I need a central repository for its data.

  1. Can I just use a normal vi as a Functional Global Variable, or do I run the risk of cloning the FGV, and therefor the data inside it?
  2. Do I need a single vi, that I call from disk once and talk to it by its queue, (and assign the queue a fixed name)

Many thanks, Alec

Link to comment

There's a bunch of ways to create a common storage point... functional globals, global variables, single-element queues, data value references... each one has it's pluses and minuses. A lot of what people use depends on personal preference.

You can use a normal VI as a functional global in a cloned VI. The reentrant setting only applies to the VI it is set in (in this case the one you are cloning). All of the subVIs have their own execution state.

I'm not clear on your item (2). It sounds like you're thinking of a single element queue, but there isn't a separate VI involved in that.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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