Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/17/2010 in all areas

  1. <--- Architect. (Despite my misgivings about certification programs, I *did* learn a bit in studying for the test). Thanks to all for so much help over the years, Joe Z.
    2 points
  2. I had a deadlock issue that has been dogging me for almost two weeks now, and I finally understand what's been happening. I figured I'd share the experience, because it to me at least, it seems to be caused by such an esoteric detail that I'm surprised I was even able to track it down. I'm hoping that if at least one other person learns something, the time I spent on this will be somewhat redeemed. So if you will, it's story time. Please examine this little bit of code. The only non-stock VI is a simple read accessor for an object. Everything else is DVR, notifier, or error related. It's LV2010 code. (Ignore the breakpoint please). This little bit of logic has proven to be the bane of my existence for some time now. I'll explain the logic briefly: This VI is meant to stop an asynchronous task that the PumpRef DVR encapsulates. The VI obtains a notifier reference, and checks for an existing notification via a 0 ms timeout. False case: If we don't timeout, that means a previous notification exists and the task has already stopped (this is the case shown in the screenshot), and no operation on the DVR is performed. True case: If we do timeout, this means the asynchronous task might still be running (yes might, just trust me on this, I said it's story time, not thesis time). So we send a signal to the asynchronous task to tell it to stop. This is not shown in the screenshot, it's in the True case of the case structure. We then release the lock on the DVR, and block on the same notifier. One of two things should happen: 1) If the false case above fired, we'll just pass right through the wait since a notification already existed. 2) If the true case fired, at this point we'll block until the asynchronous task returns, then we'll be off to the races because the last thing the task does is signal the notifier. Now there's a huge problem with this. The logic above is sound, but there's a very important implementation caveat about using the Wait on Notification primitive: Emphasis added. It's the emphasized part that bit me in the behind. The logic of the framework I'm working on is a little more complicated than the simple case I outlined here (big surprise, huh?) and it turns out that the VI will sometimes be called twice in succession. Well, guess what, in that case the logic works like this: First call, first Wait on Notification primitive: Timeout, the asynchronous task is running. A signal is sent (not shown, True case of the structure), and it starts the shutdown sequence. First call, second Wait: Blocks, eventually the asynchronous task returns, signalling the notifier, and the VI ultimately returns. Second call, first Wait: Returns notification, this particular instance of the prim has never seen the notification before. Second call, second Wait: Deadlock. Why a deadlock? Because the second instance of the Wait prim has already received the notification in the first call to the VI. It will never return. The solution you ask? Use a single element queue, and do queue previews. The lesson: Be very careful when reusing notifier primitives if you're expecting to be able to receive old notifications. Bonus points: Reentrancy does not seem to affect primitive reuse. The VI above is in fact reentrant with multiple clones flying around. If clone 1 of the VI fires first, clone 2 will still deadlock. I did not expect this (queue up another few days of debugging)... So cheers, and thanks for paying attention if you kept reading this far. -Michael
    1 point
  3. Hey guys. I have updated the LVOOP Theme Creator to LVOOP Assistant as I have added some cool new features. Check out the vids below. Feedback much appreciated. Enjoy! Cheers -JG Intro <object id="scPlayer" class="embeddedObject" width="1009" height="728" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8105de4a-4418-472a-9e60-c8b013c6465c/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8105de4a-4418-472a-9e60-c8b013c6465c/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8105de4a-4418-472a-9e60-c8b013c6465c/FirstFrame.jpg&containerwidth=1009&containerheight=728&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8105de4a-4418-472a-9e60-c8b013c6465c/LVOOP%20Assistant%20-%20Intro.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8105de4a-4418-472a-9e60-c8b013c6465c/"> </object> Rename LVOOP FP Object Labels <object id="scPlayer" class="embeddedObject" width="1009" height="728" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/61961fba-3f9d-4c67-8f39-b1f586d1b70e/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/61961fba-3f9d-4c67-8f39-b1f586d1b70e/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/61961fba-3f9d-4c67-8f39-b1f586d1b70e/FirstFrame.jpg&containerwidth=1009&containerheight=728&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/61961fba-3f9d-4c67-8f39-b1f586d1b70e/LVOOP%20Assistant%20-%20Rename%20LVOOP%20FP%20Object%20Labels.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/61961fba-3f9d-4c67-8f39-b1f586d1b70e/"> </object> Create Constructor From Template <object id="scPlayer" class="embeddedObject" width="1009" height="728" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/a58b5ff7-11f6-4d50-a9c3-b008e0af3e99/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/a58b5ff7-11f6-4d50-a9c3-b008e0af3e99/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/a58b5ff7-11f6-4d50-a9c3-b008e0af3e99/FirstFrame.jpg&containerwidth=1009&containerheight=728&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/a58b5ff7-11f6-4d50-a9c3-b008e0af3e99/LVOOP%20Assistant%20-%20Create%20Constructor%20From%20Template.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/a58b5ff7-11f6-4d50-a9c3-b008e0af3e99/"> </object> Create Scoped Virtual Folders <object id="scPlayer" class="embeddedObject" width="1009" height="728" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/14f3684e-d9fd-4152-b393-ef6843deb121/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/14f3684e-d9fd-4152-b393-ef6843deb121/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/14f3684e-d9fd-4152-b393-ef6843deb121/FirstFrame.jpg&containerwidth=1009&containerheight=728&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/14f3684e-d9fd-4152-b393-ef6843deb121/LVOOP%20Assistant%20-%20Create%20Scoped%20Virtual%20Folders.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/14f3684e-d9fd-4152-b393-ef6843deb121/"> </object> Methods Sandbox (Batch Create Static and Dynamic Methods from Template) <object id="scPlayer" class="embeddedObject" width="1009" height="728" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/c0a6f59c-b35d-422e-8e1c-4c1e1705dcaa/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/c0a6f59c-b35d-422e-8e1c-4c1e1705dcaa/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/c0a6f59c-b35d-422e-8e1c-4c1e1705dcaa/FirstFrame.jpg&containerwidth=1009&containerheight=728&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/c0a6f59c-b35d-422e-8e1c-4c1e1705dcaa/LVOOP%20Assistant%20-%20Methods%20Sandbox.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/c0a6f59c-b35d-422e-8e1c-4c1e1705dcaa/"> </object> Tools Menu Plugin (in addition to Quick Drop Interface) <object id="scPlayer" class="embeddedObject" width="1009" height="728" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/270c6792-6600-4f99-b197-00c665092661/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/270c6792-6600-4f99-b197-00c665092661/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/270c6792-6600-4f99-b197-00c665092661/FirstFrame.jpg&containerwidth=1009&containerheight=728&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/270c6792-6600-4f99-b197-00c665092661/LVOOP%20Assistant%20-%20Tools%20Menu.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/270c6792-6600-4f99-b197-00c665092661/"> </object> Unsaved Class Use Case <object id="scPlayer" class="embeddedObject" width="1009" height="728" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8aeafd6a-7cb4-459d-834c-4d62b8e6e25d/jingswfplayer.swf"> <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8aeafd6a-7cb4-459d-834c-4d62b8e6e25d/jingswfplayer.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#FFFFFF"> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8aeafd6a-7cb4-459d-834c-4d62b8e6e25d/FirstFrame.jpg&containerwidth=1009&containerheight=728&content=http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8aeafd6a-7cb4-459d-834c-4d62b8e6e25d/LVOOP%20Assistant%20-%20Unsaved%20Class.swf&blurover=false"> <param name="allowFullScreen" value="true"> <param name="scale" value="showall"> <param name="allowScriptAccess" value="always"> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LAVA%20CR/media/8aeafd6a-7cb4-459d-834c-4d62b8e6e25d/"> </object> Currently, some options are hard-coded to my style but there is no reason I can't open all this up if anyone wants me to e.g.: Link to your own Static/Dynamic method (.vit) templates Create your own Virtual Folder names etc...
    1 point
  4. "No no no no no ... wait. Global warming will destroy life on earth!!!" "... no no no no no ... now we are calling it "Climate Change". " " ... no no no no ... " "Now we are calling it """""""""Global Climate Disruption""""" " Global warming/"climate change"/ "global climate disruption" heretics/deniers now return you to your normal LAVA broadcasting ...
    1 point
  5. I feel your pain. But why limit it to classes?. Why not also be able to apply it to a load of VIs in a virtual folder. Or be able to select multiple VIs that you want to apply it too.
    1 point
  6. Just got the email this morning I passed my CLA exam at NI Week 2010. I set this goal a while back so I happy to have achieved it - this is from one of my first posts on LAVA: Like Francois, I too would love to thank everyone at LAVA, I have learned so much, and continue to learn so much on a daily basis from everyone who contributes. And it was awesome to meet a bunch of you at NI Week. Special thanks to Michael, Chris, Mark and all Mods for their hardwork on this site. Oh yer, and I still agree with myself - LAVA is kickass Woot Woot!
    1 point
×
×
  • Create New...

Important Information

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