Jump to content

Notifiers, Queues - Releasing them when you quit


Recommended Posts

QUOTE(Michael_Aivaliotis @ Oct 26 2007, 04:21 PM)

I don't think it matters when the app exits anyway, but it makes the code more readable. Avoids other programmers questioning your intent....

....I can't tell you how much work I do for that very reason. Sometimes 30 minutes of writing unnecessary code is less painful than the ad-hock meetings that occur due to the lack of that code. Good point.

Richard

Link to comment

QUOTE(BrokenArrow @ Oct 26 2007, 04:08 PM)

Is it really necessary to release Notifiers and Queues when you're exiting a program? By habit, I do it, but I'm thinking if LabVIEW is quiting, or the EXE is closing, what's the point?

It helps ensure that your application exits, rather than waiting on a notifier or queue in some other loop. I usually release all my queues and notifiers when my main loop finishes, and that forces my other loops, which use those queues and notifiers, to terminate.

Link to comment

QUOTE(ned @ Oct 26 2007, 05:20 PM)

It helps ensure that your application exits, rather than waiting on a notifier or queue in some other loop.......

Excellent point. Luckily in this app, my "consumer loop" has all of the timeouts wired to 100mS, but you know... I'm hosting an RT session, which I didn't write the VI's for... so I think I will release the notifiers. Thanks for the incentive.

Richard

Link to comment

When a top-level VI goes idle, all queues and notfiers obtained by that VI (including subVIs that were running on its behalf) are released automatically. So, no, there's no need to explicitly Close. Having said that, as others mentioned, if the VI won't go idle until the waiting queue operation finishes, you might need to explicitly close the reference in order to get the VI to go idle in the first place.

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
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.