Handling long timeouts

I'm using a PCIe-1429 with a custom camera.  The camera can generate frames at arbitrary times.  To capture images, I set a long timeout value, and then start a ring buffer with imgRingSetup (C program, Windows XP).  If I want to stop the capture, I do:
imgSessionAbort(*Sid, NULL);
imgClose(*Sid, TRUE);
imgClose(*Iid, TRUE);
If no frames are arriving, this code hangs until a timeout has occurred.  Ideally, I'd like an infinite timeout, and closing the session to happen immediately.  The imgSessionAbort documentation claims that the acquisition will be stopped immediately, but this appears to be false.  Are there any known solutions to this problem?
Thanks!
-Greg

The imgClose(*Iid, TRUE); is the call that blocks.  I have tried using imgSessionStopAcquisition - then it is the call that blocks.
I agree that it's strange behavior - perhaps off the shelf cameras are always sending frames, but some cameras (astronomy, for instance) might only emit one frame an hour.  I hope a good solution exists for this scenario.  Alternatively, if nobody else sees this behavior, then I need to figure out what I'm doing differently/wrong.  I have seen this same behavior across several different NI capture cards, OS's, and cameras.

Similar Messages

  • Handle long-running EDT tasks (f.i. TreeModel searching)

    Note: this is a cross-post from SO
    http://stackoverflow.com/questions/9378232/handle-long-running-edt-tasks-f-i-treemodel-searching
    copied below, input highly appreciated :-)
    Cheers
    Jeanette
    Trigger is a recently re-detected SwingX issue (https://java.net/jira/browse/SWINGX-1233): support deep - that is under collapsed nodes as opposed to visible nodes only, which is the current behaviour - node searching.
    "Nichts leichter als das" with all my current exposure to SwingWorker: walk the TreeModel in the background thread and update the ui in process, like shown in a crude snippet below. Fest's EDT checker is happy enough, but then it only checks on repaint (which is nicely happening on the EDT here)
    Only ... strictly speaking, that background thread must be the EDT as it is accessing (by reading) the model. So, the questions are:
    - how to implement the search thread-correctly?
    - or can we live with that risk (heavily documented, of course)
    One possibility for a special case solution would be to have a second (cloned or otherwise "same"-made) model for searching and then find the corresponding matches in the "real" model. That doesn't play overly nicely with a general searching support, as that can't know anything about any particular model, that is can't create a clone even if it wanted. Plus it would have to apply all the view sorting/filtering (in future) ...
    // a crude worker (match hard-coded and directly coupled to the ui)
    public static class SearchWorker extends SwingWorker<Void, File> {
        private Enumeration enumer;
        private JXList list;
        private JXTree tree;
        public SearchWorker(Enumeration enumer, JXList list, JXTree tree) {
            this.enumer = enumer;
            this.list = list;
            this.tree = tree;
        @Override
        protected Void doInBackground() throws Exception {
            int count = 0;
            while (enumer.hasMoreElements()) {
                count++;
                File file = (File) enumer.nextElement();
                if (match(file)) {
                    publish(file);
                if (count > 100){
                    count = 0;
                    Thread.sleep(50);
            return null;
        @Override
        protected void process(List<File> chunks) {
            for (File file : chunks) {
                ((DefaultListModel) list.getModel()).addElement(file);
                TreePath path = createPathToRoot(file);
                tree.addSelectionPath(path);
                tree.scrollPathToVisible(path);
        private TreePath createPathToRoot(File file) {
            boolean result = false;
            List<File> path = new LinkedList<File>();
            while(!result && file != null) {
                result = file.equals(tree.getModel().getRoot());
                path.add(0, file);
                file = file.getParentFile();
            return new TreePath(path.toArray());
        private boolean match(File file) {
            return file.getName().startsWith("c");
    // its usage in terms of SwingX test support
    public void interactiveDeepSearch() {
        final FileSystemModel files = new FileSystemModel(new File("."));
        final JXTree tree = new JXTree(files);
        tree.setCellRenderer(new DefaultTreeRenderer(IconValues.FILE_ICON, StringValues.FILE_NAME));
        final JXList list = new JXList(new DefaultListModel());
        list.setCellRenderer(new DefaultListRenderer(StringValues.FILE_NAME));
        list.setVisibleRowCount(20);
        JXFrame frame = wrapWithScrollingInFrame(tree, "search files");
        frame.add(new JScrollPane(list), BorderLayout.SOUTH);
        Action traverse = new AbstractAction("worker") {
            @Override
            public void actionPerformed(ActionEvent e) {
                setEnabled(false);
                Enumeration fileEnum = new PreorderModelEnumeration(files);
                SwingWorker worker = new SearchWorker(fileEnum, list, tree);
                PropertyChangeListener l = new PropertyChangeListener() {
                    @Override
                    public void propertyChange(PropertyChangeEvent evt) {
                        if (evt.getNewValue() == SwingWorker.StateValue.DONE) {
                            //T.imeOut("search end ");
                            setEnabled(true);
                            ((SwingWorker) evt.getSource()).removePropertyChangeListener(this);
                worker.addPropertyChangeListener(l);
                // T.imeOn("starting search ... ");
                worker.execute();
        addAction(frame, traverse);
        show(frame)
    }

    At the end of the day, it turned out that I asked the wrong question (or right question in a wrong context ;-): the "problem" arose by an assumed solution, the real task to solve is to support a hierarchical search algorithm (right now the AbstractSearchable is heavily skewed on linear search).
    Once that will solved, the next question might be how much a framework can do to support concrete hierarchical searchables. Given the variety of custom implementations of TreeModels, that's most probably possible only for the most simple.
    Some thoughts that came up in the discussions here and the other forums. In a concrete context, first measure if the traversal is slow: most in-memory models are lightning fast to traverse, nothing needs to be done except using the basic support.
    Only if the traversal is the bottleneck (as f.i. in the FileSystemModel implementations of SwingX) additional work is needed:
    - in a truly immutable and unmodifiable TreeModel we might get away with read-only access in a SwingWorker's background thread
    - the unmodifiable precondition is violated in lazy loading/deleting scenarios
    there might be a natural custom data structure which backs the model, which is effectively kind-of "detached" from the actual model which allows synchronization to that backing model (in both traversal and view model)
    - pass the actual search back to the database
    - use an wrapper on top of a given TreeModel which guarantees to access the underlying model on the EDT
    - "fake" background searching: actually do so in small-enough blocks on the EDT (f.i. in a Timer) so that the user doesn't notice any delay
    Whatever the technical option to a slow search, there's the same usability problem to solve: how to present the delay to the end user? And that's an entirely different story, probably even more context/requirement dependent :-)
    Thanks for all the valuable input!
    Jeanette

  • How to Handle Long running alerts in process chain...Urgent!!!

    Hi All,
    I am trying to find ways for handling long running alerts in process chains.
    I need to be sending out mails if the processes are running for longer than a threshold value.
    I did check this post:
    Re: email notification in process chain
    Appreciate if anyone can forward the code from this post or suggest me other ways of handling these long running alerts.
    My email id is [email protected]
    Thanks and Regards
    Pavana.

    Hi Ravi,
    Thanks for your reply. I do know that i will need a custom program.
    I need to be sending out mails when there is a failure and also when process are running longer than a threshold.
    Please do forward any code you have for such a custom program.
    Expecting some help from the ever giving SDN forum.
    Thanks and Regards
    Pavana
    Message was edited by:
            pav ana

  • Handling long tasks

    Hi,
    I wanted to know what's the best way to handle long tasks in
    Flex.
    In my application, I have a heavy function that processes
    lots of data from an XML file. When this function is called, the
    whole app freezes. Even the busyCursor freezes and stop turning,
    and I get the OS cursor for non-responsive application (on MacOSX a
    multi-colored turning wheel).
    Is there a way to prevent such problems ?

    there was a Interesting Topic about it here, and guys cam eup
    with some interesting Ideas, one of them was to let other swf do it
    for you with LocalConnection basically utilizing Browsers multi
    threading capabilities.
    take a look at this :
    thread
    1
    and
    this
    thread
    2

  • Handling JTA timeouts within WLS client application

              Hello
              I have a Java program which is a JMS client to WLS 7.0. I use JTA(javax.transaction.UserTransaction)
              to handle txns. I am not sure which is the best way to handle JTA timeouts.
              I found that I could catch the javax.transaction.RollbackException when I try
              to do a UserTransaction.commit(). But I am not allowed to catch weblogic.transaction.TimedOutException().
              My code looks something like this....
              UserTransaction utx;
              utx.begin();
              doSomeJMS()
              doSomeSQL()
              utx.commit();
              I would like to know what is the suggested way of catching JTA timeouts within
              my application so that I can retry the transaction.
              Thanks
              Ramdas
              

              Steve,
              Thanks for the code. It is exactly what I was looking for.
              Ramdas
              "Stephen Felts" <[email protected]> wrote:
              >The attached code works - you will get back "GOT A TIMEOUT".
              >
              >
              >
              >
              >"Ramdas Hegde" <[email protected]> wrote in message news:3f130b34$[email protected]..
              >>
              >> Hello
              >>
              >> I have a Java program which is a JMS client to WLS 7.0. I use JTA(javax.transaction.UserTransaction)
              >> to handle txns. I am not sure which is the best way to handle JTA timeouts.
              >> I found that I could catch the javax.transaction.RollbackException
              >when I try
              >> to do a UserTransaction.commit(). But I am not allowed to catch weblogic.transaction.TimedOutException().
              >>
              >> My code looks something like this....
              >>
              >> UserTransaction utx;
              >> utx.begin();
              >>
              >> ...
              >> doSomeJMS()
              >> doSomeSQL()
              >>
              >> utx.commit();
              >>
              >> I would like to know what is the suggested way of catching JTA timeouts
              >within
              >> my application so that I can retry the transaction.
              >>
              >> Thanks
              >>
              >> Ramdas
              >
              >
              

  • DelayQueue poll(long timeout, TimeUnit unit) not working

    Im trying to test out using a DelayQueue but the poll method dosen't seem to be working properly. The docs say...
    E poll(long timeout, TimeUnit unit)
    Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time if no elements with an unexpired delay are present on this queue.
    The specified wait time is one second and the elements are delayed a lot longer than that.
    Also my last if statement within the compareTo() method. What can I do to fix it? I had to add in the last return because I guess all the above return's are within conditional statements. Thanks.
    import java.util.concurrent.Delayed;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.DelayQueue;
    public class DelayTest{
    public static void main(String[] args){
      DelayQueue<DelayedElement> dq = new DelayQueue<DelayedElement>();
      dq.put(new DelayedElement(10));
      dq.put(new DelayedElement(20));
      dq.put(new DelayedElement(5));
    try{
      DelayedElement de = dq.take();
      //DelayedElement de = dq.poll(1, TimeUnit.SECONDS);
      // System.out.println(de.getDelayTime());
    }catch(InterruptedException ie){
      System.err.println(ie);
    class DelayedElement implements Delayed, Comparable<Delayed>{
    private long delay;
    public long getDelay(TimeUnit unit){
    long d = unit.convert(delay - (System.currentTimeMillis() / 1000), TimeUnit.SECONDS);
      System.out.println(delay);
      return delay;
    public DelayedElement(long delay){
      this.delay = delay;
    public long getDelayTime(){
        return delay;
    public int compareTo(Delayed other){
      if(other == this)
       return 0;
       DelayedElement x = (DelayedElement)other;
       long diff = delay - x.delay;
       if(diff < 0)
        return -1;
       else if (diff > 0)
        return 1;
        return 1;
    }

    Scrap that last question. I made some mods to the code and I switched to using take() which blocks. Problem is that take() is blocking forever. Can anyone see what I am doing wrong?
    import java.util.concurrent.Delayed;
    import java.util.concurrent.TimeUnit;
    import java.util.concurrent.DelayQueue;
    public class DelayTest{
    public static void main(String[] args){
      DelayQueue<DelayedElement> dq = new DelayQueue<DelayedElement>();
      dq.put(new DelayedElement(10));
      dq.put(new DelayedElement(20));
      dq.put(new DelayedElement(5));
    while(true){
      try{ 
      // DelayedElement de = dq.poll(); // if this queue has no elements with an unexpired delay no blocking  
       DelayedElement de = dq.take(); // waits for an expired element then remove head of queue
       if(de == null) break;
        System.out.println(de.getDelayTime());
       }catch(InterruptedException ie){
       System.err.println(ie);
    class DelayedElement implements Delayed, Comparable<Delayed>{
    private long delay;
    public long getDelay(TimeUnit unit){
      long d = unit.convert(delay, TimeUnit.MILLISECONDS);
      return d;
    public DelayedElement(long delay){
      this.delay = delay;
    public long getDelayTime(){
      return delay;
    public int compareTo(Delayed other){
      if(other == this)
       return 0;
       DelayedElement x = (DelayedElement)other;
       long diff = delay - x.delay;
       if(diff < 0){
        return -1;
        return 1;  // diff > 0
    }

  • Action handler for timeout session

    Hi experts,
         When any web dynpro application stays inactive for a long time its session gets ended. When you want to access it you will get a error like The following error text was processed in the system ECN : User session (HTTP/SMTP/..) closed after timeout .
    Any idea how to catch this event i.e. when it is getting timedout?
    Thanks & Regards,
    Monishankar C

    Hi Aditya ,
      I have created a ui element 'Timed Trigger' in my view and also created a action. Now i have put a debugger in that and executed  my application. After some time the user session is get closed when i have tried use the application but the debugger not popped up.
    So how can i come to know this action has been triggered.
    Thanks & Regards,
    Monishankar C

  • How to handle long lines in a JAD file?

    Hi all,
    setting MIDlet permissions in a JAD file easily expands the length of one line so that they need to get wrapped into 2 or more lines. AFAIK JADs actually are manifest files and the manifest file spec says that a line continuation is marked by a line beginning with a single space. I use Ant to create the JAD file and Ant's manifest task does it exactly like this. Example:
    MIDlet-Permissions: javax.microedition.io.Connector.bluetooth.client,j
    avax.microedition.io.Connector.socketThis works on my Sony Ericsson phone and in the MicroEmu emulator, but the WTK (2.5.2) emulator complains about that by throwing an exception:
    com.sun.midp.midletsuite.InvalidJadException: Reason = 28
         at com.sun.midp.midletsuite.JadProperties.partialLoad(+259)
         at com.sun.midp.midletsuite.JadProperties.load(+8)
         at com.sun.midp.dev.DevMIDletSuiteImpl.create(+252)
         at com.sun.midp.dev.DevMIDletSuiteImpl.create(+74)
         at com.sun.midp.main.Main.runLocalClass(+20)
         at com.sun.midp.main.Main.main(+80)So who is wrong here?
    Thanks for some information!
    Best regards,
    Brian

    MIDlet-Permissions: javax.microedition.io.Connector.bluetooth.client,j
    avax.microedition.io.Connector.socketif memory serves, inability to handle stuff like above is a known WTK bug.
    Try workarounds like "glueing" permissions into single (long) line or splitting them on commas

  • SAP R/3 Transports : How to handle long pending transports ?

    How to stop active transport process?
    Hi.
    Generally we transport only one TR at a time.
    If we find that any transport is stuck for any reason.
    How do we resolve this.
    When we tried to delete the Long pending transport entry, it says, long text not found. 
    The problem is, we started one transport. It got stuck for more than 30 min.
    and when we tried to delete the entry it was giving some error of long text not found.
    We tried to start another. And it also got stuck.
    How do we really handle such issues of transports.
    Though, one could say, restart of server, is the only option because there is nothing much can be done when the transport is done, one at a time, as a practice.
    Can sap not handle requests - one by one, even if the practice is to transport one TR at a time .
    Why is the system getting confused and blocks further transport requests too.
    Can anyone advise.
    Thanks
    indu

    How to stop active transport process?
    Hi.
    Generally we transport only one TR at a time.
    If we find that any transport is stuck for any reason.
    How do we resolve this.
    When we tried to delete the Long pending transport entry, it says, long text not found. 
    The problem is, we started one transport. It got stuck for more than 30 min.
    and when we tried to delete the entry it was giving some error of long text not found.
    We tried to start another. And it also got stuck.
    How do we really handle such issues of transports.
    Though, one could say, restart of server, is the only option because there is nothing much can be done when the transport is done, one at a time, as a practice.
    Can sap not handle requests - one by one, even if the practice is to transport one TR at a time .
    Why is the system getting confused and blocks further transport requests too.
    Can anyone advise.
    Thanks
    indu

  • BPM Process - Exception handling or timeout issues?

    Hi Guys,
    I have a BPM process as below.
    1. Receive step: Receive the file with multiple transactions.
    2. Transformation step: Split the file into individual transactions
    3  Block step which includes  -- par for each mode
    1. Send Step (Synchronus): Each individual transaction needs to contact the 3rd party system and get the response. --  Do i need to handle any exceptions here  ?
    2. Container : Collect all the responses 
    Block ends
    4. Transformation: combine all the responses in to a single file
    5. Send Step: synchronus -- send the above single file and get the response back
    6. Transformation : Transform the above response into the target structure.
    7.  Send: send the message asynchronusly to the target system
    I need suggestion regarding the exceptional handling or any time out issues, i need to take care of.
    any suggestions would be really appreciated
    Thanks,
    Raj
    Edited by: raj reddy on Feb 12, 2009 10:12 PM

    Hi,
    I) For the Block holding the Sync Send, create an Exception Block. (right click on Sync Send -> Insert   -> Exception Branch)
    II) Name the Exception block (ex: exceptionHandler).
    III) in the Sync Send step ->Properties -> Exceptions -> in System Error - add exceptionHandler.
    IV) Now within the Exception handler block you can create containers to hold values from payload, throw exception as email etc).
    This will cover your sync send step incase there is an error while sending the request of a timeout during receiving the response.
    You can also do the same for the Step 7) Asycn send - if required.
    Another suggestion in your question Step 6) can be done outside the bpm, when you do the interface determination for that Asycn Send you can add the Interface mapping that will map the responses to the target structure.
    Doing this will reduce one step in your BPM. For further information in how more you can fine tune your bpm, read this blog - https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/5113. [original link is broken] [original link is broken] [original link is broken]
    All the best.
    Regards,
    Balaji.M

  • Handling long running processes in APEX

    Hello Experts,
    I need your help!
    I would like to call a long running PL-Proc from an Apex-App. So I build a page for the parameters with the wizzard - all fine.
    Pressing the button starts the pl-proc - thats also fine.
    Problem: While the PL-Proc is running, there is no activity signaled in the browser. There is no way to see, that something is running in the background.
    After the pl-proc is finished, the branch to an other site took place - so the "after process" action is working as desired.
    I tried "javascript:html_Submit_Progress(this);" - but this is not a solution because there is only a very short time to reload the page itself. The PL-Proc need much more time.
    Is there a way to show the user, that background action is running?
    Any Ideas?
    Thanks for your help!
    Kind regards,
    Frank

    A few things to keep in mind. The animated gif solutions don't show a true progress bar indicator, it's just an animation on a loop. If the process takes too long, you will hit the session timeout value defined for Oracle HTTP Server.
    Another thought is this. In the code that is the long running process, make calls to [dbms_application_info.set_session_longops|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_appinf.htm#i996999] that indicate the real progress in the code. Then have a page that queries v$session_longops and refreshes every x (say 5 seconds). That page could even have an animated gif on it to indicate there is still activity.
    Tyler Muth
    http://tylermuth.wordpress.com
    [Applied Oracle Security: Developing Secure Database and Middleware Environments|http://www.amazon.com/gp/product/0071613706?ie=UTF8&tag=tylsblo-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=0071613706]

  • Handle Session Timeout

    I am using JDeveloper 11.1.1.6.
    I am trying to gracefully handle session time outs in ADF. My application has been experiencing the 'canned' ADF session timeout popup when I am logged into my application and the session has timed out. That same popup is rendered even if I am sitting at my login page but haven't signed in.
    I have followed Frank Nimphius's guidance as explained in the following forum to have my application re-direct to the login page after session timeout. That works great thanks to his well detailed document.
    ADF Faces : session timeout best practice
    The concern I have now is if I am sitting at my login page and my session times out, the application stays at the login page. I now type my credentials and click log in. Because the application thinks my session is timed out, I am taken back to the login page. Ideally I wouldn't think the login page would hold a session. Do you have any guidance on how I can get around this.

    Hi,
    what about using programmatic login, in which case the login form is part of a public page (see http://www.oracle.com/technetwork/issue-archive/2012/12-jan/o12adf-1364748.html for an example you can download)
    Frank

  • How does Flex handled long computation tasks?

    Hi
    I am using Flex3 with Java. I need to print a large document after doing some processing on it, which require about 15 seconds(varying depending on size of document). Currently, the browser will hang for around 15 seconds and after that the printing starts.
    I want to figure out how to take care of the following items
    User should be able to execute long tasks, even if the cumputaion time takes longer time, say 1 min.
    Any option for multi-threads, so that i can split the processing job to minimise the computation time.
    Option to Cancel the execution in between.
    Avoid the freezing of UI - currently, my browser is getting stuck while flex executes the print job
    Also, can I incrementally render the browser with some data during the ciompuutaion so as to engage the user to reduce the effect of computaion delay.
    Thanks
       Rakesh

    Unfortunately, the current Flash Player does not support multiple threads in ActionScript. However, the Player team is aware of the desire by developers for some form of concurrent processing and they're thinking about how to satisfy it.
    In the meantime, if you have a lot of ActionScript to execute, you have to develop some kind of "green threading" (http://en.wikipedia.org/wiki/Green_threads) of your own, or find a library that does it. The basic idea would be to use an enterFrame handler (or a Timer) and a work queue to do only a reasonable amount of computation per frame.
    Gordon Smith
    Adobe Flex SDK Team

  • Mail.app: need longer timeout when fetching mail

    How can I set mail.app's timeout for 'get mail' to a few minutes?
    A test with terminal>telnet reveals that the pop-server of my provider pauses a few minutes between the pop3 user and pass commands (doing an unsuccessfull reverse dns lookup ?). For mail.app that's too long, it gives up after 60 seconds with an error.

    I think you are running low in working memory.
    Close all programs that are running in the background.
    1. Double-click the Home button
    2. Hold down any icon until you see the minus sign
    3. Tap the minus sign to close the program
    4. Reboot the iPad

  • ITunes Version 11.0.4 (4) cannot handle long URLs

    One of my iTunes playlists contains URLs of radio stations that stream music to my computer. This works fine, EXCEPT FOR ONE STATION that has a very long URL that will not fit in the one line that iTunes allows in its small editing window, so iTunes continues the URL (which iTunes calls Where:) to a second line, but then iTunes does not know how to handle this second line, and so the music from this station will not stream. I tried editing the URL by adding a backslash to the URL just at the line break, but this did not work either. If I put this long URL into my Safari or Firefox browser, the station streams perfectly to my computer. But this is awkward, and not satisfactory compared to iTunes which is wonderful when it works........ The URL is: http://socialstreamingplayer.crystalmedianetworks.com/radio/khfm
    which iTunes breaks after radio/ so that khfm appears by itself on a second line and iTunes does not know how to handle this.
    Is there a solution for this problem?

    Unless I'm missing something, this is not a problem with iTunes. I can drag out the window so that the URL doesn't wrap but that still doesn't work. Going directly to the web site, the stream in question appears to be Flash-based and hence is not going to work in iTunes.
    Regards.

Maybe you are looking for

  • Saving as a PDF with a bleed...

    Is it possible to save a Pages file as a PDF with a bleed to send to an offset printer?

  • Ultra 10 and Creator 3D Configuration Help

    Hi. First post. Like so many others, I wanted to try Sun systems, so I got an Ultra 10 off eBay. I didn't have a 13W3 connector or monitor, so I pulled the Creator 3D card, and installed Solaris 9, using the built-in ATI video. Now that my 13W3 to HD

  • Interactive reports - dowload

    If I do group and sum in interactive report why download (pdf,xls...) don't have this group and sum which I make in interactive report?

  • Origin of departure country in delivery document (EIKP-ALAND)

    Hi, Like to know the origin of departure country at the header of delivery document (EIKP-ALAND) . Number of foreign trade data (EIKP-EXNUM) gets generated for export deliveries . Is the country of shipping point influences the field EIKP-ALAND. Than

  • Law enforcement contact within Skype

    I am a police officer in Montgomery County, Pennsylvania and am investigating a complaint. Please contact me as soon as possible. My name is Officer James Lavin and I am employed by the Upper Perk Police District. The telephone number at our station