complete execution while the background thread runs

After the passage of TestStand 4.1 in 2012, I see an interesting problem.

I start a MainSequence via the SinglePass execution entry point using the parallel model. In ProcessSetup (in the execution of N), I start a background thread that performs certain tasks for viewing. Then the model passes by "Initialize TestSockets" and starts my MainSequence (in year N + 1).

While the MainSequence is running, run N hangs in ParallelModel.seq > Single Pass, step "Wait for TestSockets", as it should. Usually, when the MainSequence is over, puts an end to execution and execution N goes to the next step "Check to terminate" and some time later, it passes through ProcessCleanup - where I'd send my background thread notification to stop.

It works as long as I do not start the background thread. But when this thread is running, the execution of N + 1 never leaves the MainSequence. I arrive at a breakpoint at the end of MainSequence, ahead, and then all executions are happily showing a green light and continue to operate on. So running N never leaves "Waiting for TestSockets" and never reaches ProcessCleanup, so my son does not receive the signal of endpoint etc.

But I distinctly remember that it worked in TestStand 4.1, and anyway, I don't understand this. Why, a background, started in the execution of N, thread prevents the execution of N + 1 to terminate?

Concerning

Peter

"When execution starts a sequence in a new thread (not waiting for the thread to finish at the end of the sequence), should take care at the end of his MainSequence wire in order to put an end to herself in order for execution to terminate?"

What do you mean by terminate? Process templates are not normally completed executions. Do you mean, "all discussions in an execution must complete before the end of the execution?"? If so, then the answer is Yes.

I'm not completely your explanations above. I'm not sure what you mean by signs, but I think you're misunderstanding what terminate means in TestStand. Termination occurs only when a user explicitly requests a run to finish (e.g. finish all) or your sequence has an action to complete or by program initiates a terminate. Without endpoint explicit that past, executions normally end when all threads are finished executing. If you are spawning runs and new threads, you must come up with a mechanism to let them know when they have to leave. I do NOT recommend relying on or using termination for this. Termination is as abandoned (but with a cleaning), it is not intended to be something that happens in the normal flow of execution. There are several ways to tell your worker when all discussions. Perhaps this posting you are referring to is a way. You can also use a notification teststand step, or a Boolean value in reference parameter.

Hope this helps to clear things up,

-Doug

Tags: NI Software

Similar Questions

  • The background thread alert does not work

    Hello

    I have read the article http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/... and followed the instructions to display the background thread alert. However, the alert is not displayed and IU locks (freezes). Specifically, the event of click/touch does not work, but the background thread continues to run.

    Structure of my program. The main class (with the main function) extends UiApplication. I create in the function main instance of the class that extends the Application. This class starts backgorund wire. I am missing something or making the wrong way?

    Sorry I have expired, I was going to write a long response to this.

    But in short, remember that your automatic boot process and your user interface process, both through main with different parameters and are the BlackBerry is concerned, different applications.  So it may be an Application, the other can be a UiApplication, and both can enterTheDispatcher.

    No two instances of the same Application, they are two different Applications.  They can be of different instances of the same Application class, but it is a special case.  It depends on what you create in the main routine.

    You can play a merry dance with such things.  For example, having a UiApplication be started by the automatic boot process, and then the boot gui process can find it and just put in the foreground, rather than creating a new UiApplication.

    Generally however people create a request and a UiApplication.  The problem with the use of these different applications, is that things like static are not shared.  Therefore, use something like RuntimeStore to share data.  It is a pain and something that if I can avoid.

    It is perfectly possible to have a UiApplication, which starts when the device starts, runs Background Threads that are working in a network and is bought in the foreground by clicking on an icon.  Code is more complicated, but not much.  And you must have complicated the code when you run the network Threads background to deal with the unit off power and then power anyway.

    Hope that clarifies somethings.

  • How to refresh uicomponents in the background thread?

    12.1.3 Jdev

    Hello, how do I update a component in the background thread?

    I have a utils that refresh method

    {} public void listener (ActionEvent event)

    refreshComp ('pb1');

    } / / This is the refresh

    {} public void listener (ActionEvent event)

    R runnable = new Runnable() {}

    @Override

    public void run() {}

    refreshComp ('pb1'); nullpointer

    }

    };

    Test thread = new Thread (r);

    test. Start();

    } / / not a refresh

    Method to utils:

    FacesContext.getCur... addPartialTarget (JSFUtils.findInRoot (id))

    No, there is not.

    This is the web application, so there are significant differences comparing to desktop applications and things must be implemented in a different way.

    Dario

  • Open a local copy or move on the server, and then disconnect while the task is running until the end

    RNOS6 running on RNDU600 +.

    Looking to start a local copy or move of the large collection of files on the server, and then disconnect the PC while the task is running until the end. For example, to move a branch of several hundreds of GB of small files from one share to another, or copy them to a share.

    Seems to make my PC (in wireless) is inefficient as each file seems to have sent to the PC first, then return to the NAS.

    Is there a way of ordering on the NAS, so that it can continue the operation even if the PC is disconnected?

    Have you tried to make using the web administration page?

  • How can I dynamically change the scale of an AIChannel, while the task is running?

    I would like to change the scale of an AIChannel while the task is running.

    Is this possible? How can I do?

    Hi Michael,

    I don't think that this is possible.  If you need this capability, I would acquire the raw tension and applying your own scaling on the set of data as being treatment.

    Kind regards

  • Failed to set the specified property while the session is running - 6552

    I created a program to run several different scripts.  The first time through my program works perfectly.  The second time through (without reset of the card, or re - download vectors etc.) but it fails.

    As he tried to run the following command:

    niHSDIO_ConfigureDataVoltageCustomLevels (DIO3_acq_session, 11-13, 18, 19', 1.8, 2.0)

    I have the following error:

    "Specified property cannot set while the session is running.
    Set the property before the opening of the session, or abandon the session before setting the property. »

    Any suggestions on what could happen?  Alternatively, any advice for troubleshooting techniques to learn more about the problem?

    I found my error:

    Several of my scripts include a list of markers so that the records are captured, and I download the recordings captured later.  Whenever I'm about to run a script that has files, I made the "niHSDIO_ConfigureAcquisitionSize" function in order to identify the size and quantity of records.

    However, the first script in my program that I run I don't need records captured, so I didn't bother to call the function "niHSDIO_ConfigureAcquisitionSize".

    So, first map like the default setting for the number of records for the first script (in which I do not bother with all the captured records), but then the subsequent pass in my stream of test cards do not like the fact that I have had set up for many more records that he caught (lack of markers / triggers).

    It's a little confusing to explain, but I found the problem, so any help is needed.

  • How to check that my application is in the context of the background thread

    I'm listening to push into the background thread, but I want to receive the push only when the application is in the background, and then how to check that the app is in the background

    check if it is listed in http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html...

  • ControlledAccessException while audio playback in the background thread

    I have a system module which is a background thread, who plays one of the ringtones pre-installed on the device. It works great in the Simulator, but on my real device (8320, 4.5.0.81, Tmobile), a ControlledAccessException is thrown and of course, plays the audio.

    The application is signed code, I tried to set all the permissions of the application to 'Allow' and nothing has worked.

    The following code fragment, that's where the exception seems to be happening:

    Player p = javax.microedition.media.Manager.createPlayer("file:///store/samples/ringtones/Alarm_EarlyRiser.mp3);
    p.realize();
    p.prefetch();
    p.start();
    

    I was hoping that among the people of the RIM (or someone else) could point me in the right direction regarding, why this is happening and how to fix this.

    Thank you

    Okay... got official word from [email protected]:

    "It is not possible programmatically to other applications pre-installed media files read, because they are encrypted DRM"

    So that answers that.

  • The call of a Subvi without stopping the execution of the main thread

    Hello everyone, I have a rather simple demonstration VI, which opens a menu where the user can call a few screws, signal generation, reading and analysis, each contained in a Subvi and with their own front panel and chart controls. The idea is user just click a button and the required Subvi is in charge, I use a structure of the event to ease.

    Problem is, after I opened an option, said Subvi hogs the thread of execution and does not allow for new bodies until it is closed (this is inside a while loop it is so logical, I guess), the queue of events and the next before Panel charges only after that I have stop the Subvi. I would like to be able to simply open the front panels and let them run in parallel, without them in the meantime another at the end, is it possible?

    natasftw is right.

    A high school is a "hole" in your main panel.  You "insert" a separate VI in this 'hole' and then you see the Panel of VI inserted through the hole and mouse clicks through the hole of the Subvi below.

    You will need to run the Subvi separately, even if - by inserting just can't run.

    Aynchronous call will begin a Subvi running and then return to the calling thread with the Subvi running in parallel.

    You can then insert the Subvi in a secondary, or let it have its own window, as you choose.

    There are examples of both techniques.

  • Application with the background thread

    IDE: Blackberry JDE Version 4.5.0.7

    Simulator: About us - Smartphone BlackBerry 2.9.0.52 Simulator

    Model: BlackBerry Curve 8310 smartphone

    Hi all

    I have an application that, after installation on the BlackBerry must be selected in the application menu only once and will run continuously until it is uninstalled from the device. Code looks like this: -.

    public final class app_name extends Application {   private BackGroundThread _thread;
    
       public static void main(String[] args) {        app_name app = new app_name();        app.enterEventDispatcher();    }
    
        public app_name() {        _thread = new BackGroundThread();         _thread.start();    }
    
        private class BackGroundThread extends Thread {
    
             public BackGroundThread() {            /***initialize parameters in constructor*****/        } 
    
             public void run() {             while(true) {             /*****do stuff using parameters*****/             sleep(10000);           }         }     }}
    

    This code works well. Now, I have to add a user interface that allows the user to change some of the parameters that are used in the thread.

    (1) as a first step, I have to change application to UiApplication to allow pushScreen to use. Since it's a subclass, I would have no problem with this law?

    (2) to get the UI goes, my plan was to declare another class (extends screen) within app_name. What is the right way to go?

    (3) parameters must be manipulated such that there is no risk of conflict of data didn't pack the thread class and the class screen try to access settings at the same time. So using the semaphore will be a good strategy?

    (4) any other questions I may be brought to face or is it better to do this quite differently? I wonder if the instance of the thread class will actually be run side-by-side in the user interface and if the user interface to stop smoking will actually affect the Backgorund thread anyway. It might be better to create a completely separate application for the bit of UI that can access this application settings, but I don't know how to do this.

    My apologies for the long post. Any help will be greatly appreciated.

    Hello

    PersistentObject is synchronized, so that it will not conflict data. You can search for "BlackBerry_Application_Developer_Guide_Volume_2" which has the details of the store persistent in the section "persistent data storage.

    Thank you.

  • Problem chart/getting updated when you press on the background thread notification dialog box

    I have a user who is graphical reports strange behviour after our request and only under the following condiitions alarms:

    1 sets of users clock back to trigger the alarm

    2 user locked the BB

    3. the user receives alarm 1 minute later

    4. the user unlocks the BB

    The strange behavior is that the background seems to resemble a back buffer bland with a rectangular hole where the notification dialog box should be.  The user clicks then the graphics and where the button should be back to normal.

    The question is not if the user does not lock the BB first - it's only under the condition of deadlock that the problem occurs.  The user statement also sometimes see a dialog "Please wait" when running our application after unlocking, but never when our application is stopped.

    Model is 8310 with 4.5 and approximately 3 MB of free space depending on the situation-> filefree.

    The dialog box is to be generated and added to the queue by a background thread using the following method:

        private void notifyUser(String msg) {
            UiEngine ui = Ui.getUiEngine();
            EncodedImage icon = Theme.getIcon(false, true);
            Bitmap bm = null;
            if (icon != null) {
                bm = icon.getBitmap();
            } else {
                bm = Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION);
            }
            synchronized (Application.getEventLock()) {
                Screen screen = new Dialog(Dialog.D_OK, msg, Dialog.OK, bm, Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_SHOW_LOWER);
            }
        }
    

    I checked the problem does not occur on the "BOLD", Pearl Flip, or 8100 with real hardware.  The problem never happens in simulators (tried about 6 models).

    Any thoughts?  Is there something wrong with the code above or spark a dialogue for a non-event like this thread?

    Thanks in advance...

    The workaround for the "locked" State is to implement MemoryCleanerListener in your main application class. This listener is notified when the device is locked. We define a property here "deviceWasLocked", then query this property of our custom popup dialog to determine if we arrive on a locked screen.

    Then we switch our application in the foreground (requestForeground) that clears up this particular issue, and any event goes well.

    The problem of 'missed calls' is a little more complicated, unfortunately, but you're not complaining that one!

    Having said all this, I'd love to see other ideas on how to solve this problem. We strugggled for several weeks with this problem when the 4.3 is released.

  • Showing a standby screen while the background processing

    Hi all

    I implement a wizard have been I let the user fill in some parameters of network connection. When the user clicks 'next' I want to run a background process to see if the entered parameters are correct. According to the result of the background process, the wizard can continue to the next screen or remain on the current screen.

    There must be something like this:

    boolean onNext()
    {
      // Executed when the user presses 'next' (run in the EDT)
    
      // Show a wait popup
      UiApplication.getUiApplication().pushScreen(progressPopup);
    
      // do my network stuff
      boolean success = false;
      UiApplication.getUiApplication().invokeAndWait(new Runnable()
      {
        public void run()
        {
          // try to connect to the network
          // ...
          success = true;
        }
       });
    
      // hide the popup
      UiApplication.getUiApplication().popScreen(progressPopup);  
    
      // return whether the network stuff was successful
      return success;
    }
    

    This does not work because the popup does not appear. How can I achieve that?

    Thanks in advance!

    Modal screen is very good and has some advantages, in that it means that your logic that knows what it is in the State.

    What you want to do depends on the application.  For example, we have a server locator tool, the user launches the search, then we do not secure anything, except that they cannot launch a new search until they cancel the old one.  Alert us when the search is completed or dead or expired.

    With a modal form (and we do too) I personally like this to have a Cancel button, so that the user can stop waiting - which complicates the Interface.  In fact, there is a case for the wireless network to bring an observer of the screen modal, so that he knows that he has to ignore the answer if the screen has been cancelled.

  • Copy VM files while the VM is running

    What happens if I try to copy the virtual computer files (.vmx, hard, etc.) to another disk while the VM is:

    • on,
    • used, and
    • some files (documents, for example) are being modified

    I guess it wasn't all "best practices".  But the files would be damaged or unusable?  Could we all backups of these files?  If so, would compromise the open files?

    Thanks in advance.

    Welcome to the community,

    You may be able to copy configuration files (vmx, vmsd, etc.) However, you cannot copy the virtual disk file (vmdk) while it's assets vmdk. You'd probably end up with either a "file in use" or "timeout" error. If you find a tool that would continue the copy in the copy resulting would be corrupted. This is why all backup applications create a snapshot before you copy the vmdk and commit the snapshot once the backup is complete. When you create a snapshot, the virtual disk parent is used in "read only" mode by running virtual machine and can be copied.

    André

  • Update of Audio devices while the program is running

    Hello

    I want to connect to a device audio all in a labview VI is running. When I do, the audio device does not appear in the list of audio devices. Will there be any node of activeX or another possibility to refresh the audio in labview devices, while a VI is running?

    I use Windows XP and LabVIEW 2010, but I think that an upgrade for 2011 would not solve my problem.

    Hi Angelica,.

    just spoke to a colleague on the issue and we have now resolved. The solution are VI references and call forwarding.

    Take a look at the example in the attachment. The use of this piece of code, the 'get Num Devices' function (as an example for all other functions that you want to use) is reloaded each time it is called, resulting in the numeration of device updated when executing.

    Good luck using it and best regards,

    Benjamin

  • push the two overall display of the background thread

    Hello

    I am pushing GLOBAL SCREEN of my background thread using synchronized (Application.getEventLock ()).

    Now, I want to push another SCREEN on this GLOBAL SCREEN.

    But the new SCREEN is not visible on the GLOBAL SCREEN.

    Please help me

    When you push your overall screen make sure that you also provide a priority:

    pushGlobalScreen (aScreen, PRIO_as_INT, UiEngine.GLOBAL_SHOW_LOWER);

    where 0 is the most high prio (always on top)... I use it to mix screens above the other... Screens with the same priirity will display above the other - the last pushed to win...

Maybe you are looking for

  • Photosmart c410 printing blank pages

    I have a photosmart c410, macbook pro 0sx 10.7.5. T10.7.5. all was swell but all of a sudden my printer put the blank pages.  I can't even test page to print

  • HP Pavilion a1310y: can not find the drivers for Pavilion a1310y on Win 7

    Hello worldI installed my mother HP Pavilion a1310y to Windows 7 Pro. It works great except for what seems to me to be pilots. The audio does not work and the screen is the thing where everything is bigger and looks like he needs an update.On-site HP

  • C4780 keeps losing wireless connection after 24 hours

    I think I've tried almost everything this mentioned on this forum... Sitecom router dhcp mode, range 192.168.1.40 - 192.168.1.80, the firewall is disabled printer is powered 192.168.1.100 (static, after having the same problems with Dynamics) Gateway

  • Possible to add more RAM, maximum allowed on HP - Compaq Presario SR5233WM?

    HP-Compaq Presario SR 5233WM PC, Windows Vista Edition Home Premium, drive HARD 250, 2.8 ghz and 2 GB of RAM now.   (from 2007ish) The specification of State HP 2 GB document.  I've read elsewhere in their manual maybe says 4 GB, but I do not. I chec

  • How do I reinstall Windows (installed new HDD) 8

    My laptop is dead needs a new drive hard of... My Windows 8 is an OS upgrade.  How can I get the 8 Windows installed if I do not have the older versions of the Windows ME/XP/Vista/7.  They were all existing operating system upgrades