BrokenArrow Posted October 27, 2007 Report Share Posted October 27, 2007 Hello all, 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? Thanks, Richard Quote Link to comment
Michael Aivaliotis Posted October 27, 2007 Report Share Posted October 27, 2007 I don't think it matters when the app exits anyway, but it makes the code more readable. Avoids other programmers questioning your intent. Quote Link to comment
BrokenArrow Posted October 27, 2007 Author Report Share Posted October 27, 2007 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 Quote Link to comment
ned Posted October 27, 2007 Report Share Posted October 27, 2007 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. Quote Link to comment
BrokenArrow Posted October 28, 2007 Author Report Share Posted October 28, 2007 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 Quote Link to comment
Aristos Queue Posted October 29, 2007 Report Share Posted October 29, 2007 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.