Why is time-critical thread not interrupting sleepless high priority thread?

Hello,
I have two threads running in the same execution system on a real-time PXI platform. The time-critical thread sleeps using "AI Single Scan.VI", and acquires my data at a rate of 8000 Hz.
I have a slower high priority process that calls a DLL function to calculate some filter coefficients. This function call takes longer than 1/8000 s to complete, and runs in a loop, executing as often as it can (with new data from FIFOs).
I expected the time-critical thread to interrupt the the high priority thread without problem.
I am finding that unless I insert a LabVIEW delay (for example a wait for x ms VI) in the loop, the real-time system stops responding. With a small delay (ie 1 ms), t
he acquisition completes, and a FIFO shuts down the loop of the slow process.
Why do I need a labVIEW delay in the high-priority loop, when the DLL function call itself is quite slow? Even without a DLL call, I would expect the time-critical VI to interrupt, finish its data acquisition, and shut-down the high-priority thread using its FIFO.
Any suggestions?
Thanks in advance,
Frenk

Here are a couple things to try/check:
1) Check the call library node in your high priority VI. If it's orange (runs in UI thread), your high priority VI is actually switching to the UI thread every time your dll runs. That alone is not a problem. But if your TC VI tries to update any control terminals, the TC thread will switch over to the UI thread to access UI resources, possibly while the dll within your high priority VI has a lock on those resources. Why does the dll have a lock on UI resources? Because it was running in the UI thread and got interrupted by the TC thread before it finished doing its business. Not likely, but possible.
2) There's another possible reason you're seeing this behavior. If the TC VI and the high VI call a mutual subVI, the subVI will be elevated to ALWAYS run in the highest priority thread irrespective of the actual caller (in your case, it's the the TC thread). Even when the *high priority VI* calls the mutual subVI, that subVI runs in the time-critical thread, which means there's a thread switch from high to TC, then back to high after the subVI finishes. And because high and TC VIs are in the same exec system, that mutual subVI will always run in the 1 and only TC thread alotted to that exec system.
So, while your TC VI is running, you're in the TC thread. While, your high VI is running, you're in a high non-TC thread, and when your high VI calls the mutual subVI, you're again in the TC thread until the subVI finishes.
So how could this arrangement cause your TC VI to become starved by the high VI? If your TC VI wakes up while the high VI is in the middle of running the mutual subVI, the TC thread responsible for running the TC VI is actually busy (in the middle of running the subVI in your high VI!!!), so the TC thread cannot run your TC VI until it finishes running that mutual subVI.
The fix: make your TC VI run in a different exec system. It will be given its own TC thread that no one else can mess with. When TC VI wakes up, it's guaranteed a TC thread.
I think there's a good reason behind why a mutual subVI ALWAYs runs at the highest priority of all its callers, irrespective of the actual caller's priority...but I can't think of the reason at the moment.

Similar Messages

  • Why is Time machine backup not working after Mavericks upgrade?

    Why is Time machine backup not working after Mavericks upgrade?

    I had the same problem due to the Fire Wire port.  Apple tested it told me it is OK!, I tried a new cable, and have tested both ports on my back up device.  I find it strange that as soon as I installed Mavericks.  The drive does work using USB.  It could be a coincidence, I don't absolutely know at this point, my back up drive ports could stop working, but I doubt it!

  • Why my timer job is not running?

    I have a server farm configuration with 1 web server, 2 app servers and 1 database server.
    What i am trying to do from timer job is to loop through all web applications present in the server farm and perform some action against some web-applications.
    I have timer job which is provisioned with web-application(central admin web app) and locktype as contentDatabse passed as parameter, and i have scheduled this job to run every  2 minutes. This timer job is provisioned by a feature which has a farm
    scope.
    My timer job never runs.
    If i stop the SharePoint timer service running in the app servers my timer job runs. From this
    blog i have came to know that "So, the first thing is that for a particular server to be eligible to run the job, it must be provisioned
    with the service or web app associated with the job." And my app servers does not host the web applications.
    My questions is.
    1. Why is my timer job is trying to run from the app servers?
    2. If i pass a web server while provisioning timer job is that correct? I think timer job becomes tied to particular server and removing/
    taking it down may make the timer job not to run.
    Thanks,
    Mallikarjun
    mallikarjun

     Try to deploy the Timer job from Web Front end not Application server. And try to Activate from there only . 
    Thanks and Regards
    Er.Pradipta Nayak
    Visit my Blog
    Xchanging

  • Why is Times New Roman not displaying correctly in Illustrator CS5?

    Alright, so I'm running Windows 7 64-bit and Illustrator CS5.
    Times New Roman Regular does not display correctly on my machine when using Illustrator CS5, but Bold, Italic, Italic Bold display just fine.  Times New Roman does display correctly in every other program I use.  InDesign, Word, etc.  I've attached a screenshot to show what I mean.  Please help!

    Hi,
    I have an absolutely same bug - looks like font substitute
    I had reinstall font family - no changes. Win 8.1 Illustrator CC.

  • Why some times jdeveloper does not show a coreect design view ?

    Hi
    thank you for reading my post
    why jdeveloper does not show a correct design view of jsf pages sometimes?
    It does not shows labels and ... , just show tag names like : form , ... ?
    here is a picture for this :
    1-incorrect page:
    http://www.flickr.com/photos/59086726@N00/217556594/
    2-correct page :
    http://www.flickr.com/photos/59086726@N00/217556595/
    I just closed and open the IDE and page designer shows incorrect pages
    thanks

    Also try this...go to the project properties for the View project. Look at the JSF Libraries and remove the two JSF libraries and then re-add them....this sometimes helps.
    Regards
    Grant Ronald

  • Why does Time Stamp Control not produce a Absolute Time output?

    I have used the the Time Stamp Control for manual input of measurement information. However, this control produce a time stamp in relative time which is unwanted. I thought that Time Stamps always are in Absolute Time. Is this not true? The control is very handy for time and date inputs. Is there a way of changing the output to relative time?

    I will try to be more specific:
    There is a Time Stamp Control available in the controls palette for use on the front panel. This can be used to set a variable called Time Stamp with values of time and date. It has a time and date browser which is very convenient to use and I like to use it. The time format I prefer in this case is Absolute Time which is time-zone-independent and it is the number of seconds elapsed since 12:00 a. m., Friday 1, 1904, Universal time according to LabVIEW help. However, the output from the Time Stamp Control is in Relative Time which I think is the Absolute Time compensated with Dayligth Saving Time and the local Time zone setting in your system.
    Time Stamps are always in Absolute Time I think but not in this case.
    My problem may be solved with a VI similar to "Format Date/Time String Function" but with a time stamp input and output, since this VI converts from Absolute time to Relative time. Even better is of course having a Time Stamp Control where you can select between absolute and relative time.

  • First time data is not transported to pop up window through event handler

    Hi all,
    I am using NWDS 7.0, Now I want to open a pop up on click of a action link.
    There are two DCs DC-A and DC-B.
    I am calling action from DC-A to DC-B. DC-B contains view of pop up window.
    In DC-A I am using intreface controller of DC-B by using used coponents.
    Now In the DC-B used components I have created one fireplugin which is connected ith pop up view of DC-B and that firplugin is called from DC-A action to transport data from Dc-A to DC-B.
    Problem : when I click first time to open pop-up window then event handler is not called but the windows opened. When I close that window and again open the transported data start displaying on pop up window.
    So can you please help me that why first time data is not transported to pop up window.
    Thanks
    Kaushal

    You'll need to use an OARawTextBean. Oracle doesn't support opening links in new windows using OAFormattedTextBean. Just be aware that you'll need to set the CSS class in the HTML as well if you need it formatted a certain way.

  • RTSJ thread priorities, Lower priority thread running

    Hi,
    I'm experimenting with a thread pool that I've written containing javax.realtime.RealtimeThreads. I'm trying to use this to replace a java.util.concurrent.Exectutor type thread pool in an existing application. My design involves a Queue where the RealtimeThreads wait on until a Task is submitted for execution. All the threads in the pool start at the lowest priority and upon the submission of a task, I have written some logic to increase the priorities of the threads that I want run.
    At a given time, there could be many threads with tasks assigned to them and some without tasks. My algorithm to decide which thread is to be given the CPU, runs every time a task is submitted to the system as well as at the end of the current thread execution. I assumed that If I set a thread's priority higher than the others it would automatically be given the CPU and all I have to do is to set the Priority using rtThreadObject.setPriority() method. I obtain the highest priority in the system through PriorityScheduler.instance().getMaxPriority() method and do similarity to obtain the Normal and Lowest priorities in the system.
    Recently I added some code to change the priority of a thread from another, and noticed that the target thread's priority is higher than the one that is currently running. I'm not sure how a lower priority thread can run, when a higher priority thread is already in the system. I'm wondering whether it's to do with the current thread of execution getting woken up by a task submission (I do a QueueObject.notify() ) and continue to run at the lower priority, I have my doubts on it. Can anyone give some ideas as to how such an instance could exist?
    I'm developing on a Linux-RT kernel with RTSJ 2.1
    Thanks,
    Vidura

    Sorry for the delayed response.
    Thanks a lot for the answer. This certainly might be the case in my scenario as well. However, is there a way that I could query the active priority from a Thread and confirm? I also have a few questions just to confirm my thoughts on such a scenario.There is no way to query the active priority of a thread.
    1) Can Priority inheritance take place if a high priority thread is blocked on some IO operation say even a simple System.out.println ?Priority inheritance occurs when a thread holding a monitor causes a higher-priority thread to block trying to acquire that monitor. At that point the thread holding the monitor is given the priority of the thread it is blocking. So this can happen anytime a lock is held, regardless of what the thread is doing at the time.
    2) In the simple scenario of a couple of threads with different being active at the same time with Java or RTSJ in particular, as long as the threads are not blocked or competing for a shared resource, is it possible to assume that the highest priority thread will get the CPU 100% of the time?The simple answer is "yes" but reality is more complex. Shared resources occur at the application, VM/runtime-library, and OS levels. You would have to avoid them at all levels to ensure the highest base priority thread is also the highest active priority.
    3) If we as programmers takes great care in preventing IO operations (or controlling any IO operations, i.e. where to place them in the code) even simple as a System.out, priority inversions or inheritance would not take place?Priority inheritance is not directly related to I/O operations - the issue is whether methods are synchronized or not.
    4) In such a scenario highlighted in 3, what practices could be used to debug the code if needed?On Solaris we use DTrace and the Thread Scheduling Visualizer for debugging timing/scheduling relationships. I'm afraid we don't have anything equivalent on Linux at this this time.
    As for exactly what I'm trying to do, it's a bit convoluted as I'm trying to achieve predictability in an existing product using RTSJ, that wouldn't be used in the trivial real-time sense, like an embedded environment, rather as a normal application. I will follow up with more details of it if needed.Don't worry, we have numerous users applying real-time Java to "normal" applications. :)
    David Holmes

  • Why does that entire thread goes to sleep when we put a wait function in time critical loop?

    why does that entire thread goes to sleep when we put a wait function in time critical loop but not when it is not time critical

    Norbert B wrote:
    Ujjval,
    in a RT system, priorities have (in general) increased effect on the execution of the application.
    It is recommended that you only have a single task in your RT program at "time critical". If you have two task "time critical" (that means you are running into issues caused by your quoted "feature"), you have a flaw in your application architecture.
    Since LV 7.1, it is recommended to work with Timed Loops in order to prioritize tasks on a RT system. Timed Loops are executed on priorities between "time critical" and "above normal". Each Timed Loop will execute its content in a single thread in order to keep a good overview of the timing (like finished late [i-1]). Using those structures (and according settings) in a reasoned manner will prevent your RT system to run into priority issues.
    Ujjval Shah wrote:
    [...]also i would really appreciate if i can get more documentations regarding how LV creates threads and assigns subvis to them[...]
    You will have a real hard time to go into this very deep. This is the feature of LV: you can just use multithreading (multicores) without the needed knowledge of scheduling and load balancing. This makes LV programming in general very easy in comparison to e.g. ANSI C (in regard of multithreading). So creation of threads, distribution of tasks to the threads are abstracted and most often not visible to the programmer.
    There are some switches and levers you can "play around" in order to make LV to behave differently in this matter. But this most often requires  deep LV knowledge and cannot be explained in a simple posting.....
    hope this helps,
    Norbert 
    Amen to that!
    The question can not be fully answered without digging into the internals of the OS LV is run on because LV works with the OS and lets it do the scheduling.
    Yes that note applies to pre- LV 7 RT. When run under RT the ONE Time Critical loop was guarenteed to stay determinisitic.
    Since then the Timed Loop was introduced that allowed multiple levels of priority and later allowed us to assign which CPU the code would run on.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Why does Time Machine not work over wifi but only via ethernet cable ?

    Hi everyone,
    It's been some time I have this problem now.
    The first time I backed up my mac within Time Capsule with time machine, I chose to use the ethernet cable because the gigabit connection is much faster than the wifi for the first back up, but now, any time I want to update this back up, I need to connect the cable, cause "Time Machine can not connect to the Drive I picked" over wifi.
    This is so annoying. Does anyone have a similar issue ?
    Any solution ?
    When I got this "error" I can use Utility Airport and get full access to the drive, even in finder. The only thing that doesn't work is TimeMachine connecting to the drive, even if it is detected by TimeMachine itself.
    Thanks.
    Riccardo

    Typical Yosemite.
    I suggest a full reconfigure of the TC.
    Follow this list..
    No files are deleted on the TC doing this although you might have to repoint your laptop to the backup.
    Note.. even if TM does connect it will say it is going to do a new backup.. it is only when it starts that it discovers the backup exists and increments it.
    Start from a factory reset. No files are lost on the hard disk doing this.
    Factory reset universal
    Power off the TC.. ie pull the power cord or power off at the wall.. wait 10sec.. hold in the reset button.. be gentle.. power on again still holding in reset.. and keep holding it in for another 10sec. You may need some help as it is hard to both hold in reset and apply power. It will show success by rapidly blinking the front led. Release the reset.. and wait a couple of min for the TC to reset and come back with factory settings. If the front LED doesn’t blink rapidly you missed it and simply try again. The reset is fairly fragile in these.. press it so you feel it just click and no more.. I have seen people bend the lever or even break it. I use a toothpick as tool.
    N.B. None of your files on the hard disk of the TC are deleted.. this simply clears out the router settings of the TC.
    Setup the TC again.
    Then redo the setup from the computer with Yosemite.
    1. Use very short names.. NOT APPLE RECOMMENDED names. No spaces and pure alphanumerics.
    eg TCgen5 for basestation and and TCwifi wireless name.
    If the issue is wireless use TC24ghz and TC5ghz with fixed channels as this also seems to help stop the nonsense. But this can be tried in the second round. ie plan on a first and second round of changes to fix this.. hopefully.. I will point out other steps that can be round2.
    2. Use all passwords that also comply with 1. but can be a bit longer. ie 8-20 characters mixed case and numbers.. no non-alphanumerics.
    3. If the TC is main router you can skip this point. This is only an issue when the TC is bridged.
    Ensure the TC always takes the same IP address.. you will need to do this on the main router using dhcp reservation.. or a bit more complex setup using static IP in the TC. But this is important.. having IP drift all over the place when Yosemite cannot remember its own name for 5 min after a reboot makes for poor networking.
    4. Check your share name on the computer is not changing.. make sure it also complies with the above.. short no spaces and pure alphanumeric.. but this change will mess up your TM backup.. so be prepared to do a new full backup. Sorry.. keep this one for second round if you want to avoid a new backup.
    5. Mount the TC disk in the computer manually.
    In Finder, Go, Connect to server from the top menu,
    Type in SMB://192.168.0.254 (or whatever the TC ip is which you have now made static. As a router by default it is 10.0.1.1 and I encourage people to stick with that unless you know what you are doing).
    You can use name.. SMB://TCgen5.local where you replace TCgen5 with your TC name.. local is the default domain of the TC and doesn't change.
    However names are not so easy as IP address.. nor as reliable. At least not in Yosemite they aren't. The domain can also be an issue if you are not plugged or wireless directly to the TC.
    6. Make sure IPv6 is set to link-local only in the computer. For example wireless open the network preferences, wireless and advanced / TCP/IP.. and fix the IPv6. to link-local only. Do the same for ethernet if you use it.
    There is a lot more jiggery pokery you can try but the above is a good start.. if you find it still unreliable.. don't be surprised.
    You might need to do some more work on the computer itself. eg Reset the PRAM.. has helped some people. Clean install of the OS is also helpful if you upgrade installed.
    Tell us how you go.
    Someone posted a solution.. See this thread.
    Macbook can't find Time Capsule anymore
    Start from the bottom and work up.. I have a list of good network practice changes but I have avoided Yosemites bug heaven.
    Yosemite has serious DNS bug in the networking application.. here is the lets say more arcane method of fixing it by doing a network transplant from mavericks.
    http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-is-broken-and-what-yo u-can-do-to-fix-it/

  • Returning to a VI after a time critical interrupt

    How does LabVIEW RT return to the non-time critical VI when the time critical VI is asleep? Does it restart where it left off before the it was interrupted?...or does it restart the non-critical VIs from the beginning?

    The short answer is the non-time-critical VI starts from where it left off. However, there are special cases called priority inversions where the non-time-critical VI was accessing a "shared resource" when the time-critical VI interrupted it. If the time-critical VI needs this shared resource too, the RTOS will recognize this resource contention and put the time-critical VI back to sleep. At this point, the RTOS elevates the priority of the non-time-critical VI to TIME-CRITICAL long enough to allow the non-time-critical VI to release the shared resource. Once the shared resource is relinquished, the time-critical VI can once again interrupt the non-time-critical VI, run, go back to sleep, and allow the the non-time-critical VI to continue running where it left
    off.
    The Knowledgebase has a few articles about shared resources and LabVIEW RT. Shared resources include the Memory Manager, semaphores, single-threaded DLLS (such as traditional NI-DAQ), non-reentrant subVIs called by two or more parent VIs, etc.

  • Im using a network drive with time machine and im getting error 45. Time machine will not work now. Why?

    I bought a seagate goflex home 2TB network drive. It worked with time machine for a couple of weeks than now it wont. It just says ERROR 45 now and will not back up. Why?

    Welcome to Apple Support Communities.
    According to several related Time Machine Error 45 threads in these forums, Time Machine is not well suited to backups on most non-Apple network drives.
    https://discussions.apple.com/message/10744727#10744727
    https://discussions.apple.com/message/15643759#15643759
    https://discussions.apple.com/message/11929252#11929252
    https://discussions.apple.com/message/13164522#13164522
    One of the discussions provides an off-site link to these suggestions:
    http://web.me.com/pondini/Time_Machine/Troubleshooting.html

  • Why some times delivery  will created through vl10c even sale order stock is not available?

    Hi,
    why some times delivery  will created through vl10c in batchmode even sale order stock is not available?
    Thanks,
    Kalyan.

    the correct english name is : Replenishment leadtime
    Check with Replenishment lead time - Supply Chain Management (SCM) - SCN Wiki

  • As a novice computer user, I wonder why I'm often getting "white-out" (program/app I'm working in goes totally blank onscreen). If it makes a difference, I'm working 99% of the time on battery, not AC, power. What causes this?

    As a novice computer user, I wonder why I'm often getting "white-out" (program/app/site I'm working in goes totally blank onscreen). This is when I'm Internet online. If it makes a difference, I'm working 99% of the time on battery, not AC, power. Some of the possibilities I'm guessing are: glitches in my Verizon FiOS Wi-Fi providership?; staying too long on a site that's waiting for me to finish and "Submit"?; computer hardware prob (yikes, I hope not! It's brand new). Any ideas out there?

    When this 'white-out' occurs, is the display 100% white with no error message and no menu bar?
    Does this occur when you are using Wi Fi or connected to the Internet via the Ethernet cable?
    Ciao.

  • Why my iPod (6th generation)not appearing in iTunes and all my songs are gone but the data is the same with last time when got songs.

    why my iPod (6th generation)not appearing in iTunes and all my songs are gone but the data is the same with last time when got songs.

    I understand that your iPod nano is not recognized in iTunes. The following troubleshooting assistant may provide a resolution:
    Apple - Support - iPod nano (6th generation) - iTunes Troubleshooting Assistant
    http://www.apple.com/support/ipodnano/6th_generation/assistant/itunes/
    If the above did not resolve your issue, choose an applicable article below that best describes your issue.
    Windows
    iPod appears in Windows but not in iTunes
    iPod not recognized in 'My Computer' and in iTunes for Windows
    iTunes reports that "iTunes cannot recognize this iPod at this time"
    Mac OS X
    iPod not recognized in iTunes and Mac Desktop
    MacBook and MacBook Air: iPod won't mount when connected via USB hub
    What to do if your computer won't recognize a USB or FireWire device
    Thanks,
    Matt M. 

Maybe you are looking for

  • Need help in writinf a stop script for a production server

    can somebody help me with a stop script which stops a jrun production server. jrun -stop production this command should work but how do i use this in a script . Thanks

  • Erorr code 4014

    Hi My second Ipad 2 4th gen. First had trouble connecting to the internet Apple replace under warranty in October 2013.The warranty expiried November 2013. Now my replacement has now unexpectly turn off i have tried rebooting through itunes which say

  • Search using a specific user without providing password

    Hi Experts, I'm trying to impersonate a search in FAST or atleast in Sharepoint search without providing the password. Below is a similar thread. http://social.technet.microsoft.com/Forums/en/sharepointsearchlegacy/thread/49475fbc-3c6d-42f2-bf35-8236

  • DMEE - Output in the required format

    Hi I need an output in this format: ........1........2........3........4........5........6.... 101 DEUT0797B CoCd    0905271433A094101DEUTSCHE BANK          Company Name         <CR/LF> 5200Company Name Payment Type      1         CCD     090527   1D

  • Backed up data dvd-rw will not mount on my desktop?

    a few months ago, i used retrospect to backup files onto five verbatim dvd-rw disks. the backups went fine and after they each were done i checked them to make sure that the backup was successful (which in all cases it was). recently i wanted to upda