Is it possible to enter into function twice before leaving?

I have an executable that includes a user interface, and on the user interface, there are 2 Timer controls, each using the same callback function, but each timer is set at a different rate.  The reason this way of coding is not important, but the fact that it is coded like that is necessary to know to answer the question.

The executable is single threaded, so it is expected that all flow of execution works in the order.  However, we have seen evidence, in a log file, the callback function to the two timers came twice before leaving.

Excerpt from the log file:

04 21 2014 12:29:03: leave<- -="">
04 21 2014 12:29:03: entry-> - 29
04 21 2014 12:29:03: leave<- -="">
04 21 2014 12:29:03: entry-> - 24
04 21 2014 12:29:04: leave<- -="">
04 21 2014 12:29:04: entry-> - 30
04 21 2014 12:29:04: entry-> - 28
04 21 2014 12:29:04: leave<- -="">
04 21 2014 12:29:04: leave<- -="">
04 21 2014 12:29:04: entry-> - 30
04 21 2014 12:29:04: leave<- -="">
04 21 2014 12:29:04: entry-> - 31
04 21 2014 12:29:04: leave<- -="">
04 21 2014 12:29:04: entry-> - 30

Where the fields are: length - message - time (using length = clock() between calls to the function of logging.)

I can understand than two timers is not the value of the identical periods tick will conflict eventually, and might as well generate EVENT_TIMER_TICKs before each event is handled, but I expect not to see the workflow execution in the same C function (in this case our reminder) twice before the first call workflow execution stops.

As it is that no application multi-threading level and there is no recursion, how does this happen? that is, he threw internal Threading or fiber deployed to invoke a timer of the UI control? (I always thought of the documentation of the Timer controls used strictly in the main thread, in contrast, Async timers, for example, running in a separate thread)

"Timer events are not nested" is equivalent to entering a function twice before leaving the flow of execution. Basically, it's the same thing as recursion base: while you are inside a function, you call this function. The only difference between this case and the recurrence of basis is that the appeal of recursion is not explicit and implicit (via ProcessSystemEvents). But the end result is the same.

I'm sorry, I couldn't find any documentation that explains that the individual counters are not reentrant (i.e. cannot fit). I was talking about what I know, but I couldn't find that it documented anywhere.

The only reason why you have reentrancy in your case is because you have two timers, both using the same callback. If you have assigned different reminders for them, then you should be able to rely on no reentrancy for each function.

Tags: NI Software

Similar Questions

  • Auto check box when test is entered into a trial field

    Hello

    I was wondering if HRT is possible. I have created a form using Acrobat X and I have a list of software for users to choose with a checkbox next to them. I also have an option for the user of software that was not the name. Is it possible to have this check box selected automatically when text is entered into the text field?

    Thank you

    Of course, you can use a validation script customized to the text field that looks like:

    Custom validation script

    getField("checkbox1").value = event.value? 'Yes': 'Off '.

    Replace 'Yes' with the value of real export of the box (which by default is 'Yes') and 'checkbox1' with the actual name of the corresponding checkbox.

  • Updated 2011 MacBook Pro at El Capitan 10.11.4. At the opening of the Photos, he entered into mode 'Library Preparation', but was stuck at 50% complete for more than 30 minutes. What should I do?

    Updated 2011 MacBook Pro at El Capitan 10.11.4. At the opening of the Photos, he entered into mode 'Library Preparation', but was stuck at 50% complete for more than 30 minutes. What should I do?

    Give it time - it may take a few hours depending on the size of your library is

    LN

  • G8D94PA #ACJ: is it possible to change the function of the FN keys?

    Hello

    I sometimes use windows 7 32-bit due to my software dependency. in some software I have to use fn keys (F1 to F12) frequently with the combination of other keys. It is possible to enable the functionality of the fn keys as from now on if I have to use F5, so I use FN + F5 combination. So in this software I have to use F2 to F7 & I have to press CTRL + ALT + FN + F2 to F7.

    Please share any solution...

    Hello

    Shut down the laptop.  Tap away at the esc you key start Notepad to open the Start Menu.  Select the Bios ( f10 ) option, and then change the figure in the document at the following link.

    http://support.HP.com/us-en/document/c02035108

    Kind regards

    DP - K

  • Letters change to the capitals and enter the function is blocked

    L.S.

    I use a Probook 4730 s 64-bit.

    I type blind

    So maybe I'm doing something wrong while typing. When I am typing in a box like that or Skype or MSN or a contact form used by companies to ask the question while typing the letters change in capitals and stops function entry when I hit enter the entire section is turned blue.

    Enter the function stops completely in the form and I have to restart the computer because it affects now all entries and try to fill in the form again. Most of the time the second time, it will work. Before that I use Mozilla, but because it is not applicable for the 64 bit, now I use Chrome.

    Nobody knows what I did wrong. Or where can I fix.

    Thank you.

    Louise

    Your laptop is a company/business model. I would recommend this announcement in the HP Enterprise Support Forums for the best coverage, because it's the consumer support forums.

    You can access support at the following link enterprise forums.

    http://goo.GL/LsnuK

  • Is it possible to trigger a function Javascript C++ QML?

    Is it possible to trigger a function Javascript C++ QML?

    Just look at the section of signals and slots that documentation for examples of how to define and send signals of C++. Then in your QML, where you have exposed your C++ object as a property of context (named, for example, "foo"), you would foo.signalName.connect (myJsFunction) in a certain place like maybe onCreationCompleted. Connects the signal to the function, and when it is executed will be called the JS function.

    In short, the real connection between the two is trivial, as long as you already have all the side "C++ object and signal and exhibitors being C++" processed things.

  • Entering into Lightroom, all my photos have a grey tinge on them.

    Entering into Lightroom, all my photos have a tint gray above them, someone has this problem. Thank you.

    You are showing the import dialog box. This is an indication that the files were previously imported and are already in the catalog.

  • When buying, there was no possibility of entering an number TVA - is - it possible in hindsight?

    Hello

    I bought two copies of InDesign CC.

    The first copy was given no opportunity to enter a VAT number, as a result, I am in charge £17,15 per month.

    The second copy was the possibility to enter a VAT number, for that, I am in charge £14,29 per month.

    Can change you my account so the first copy is loaded £14,29 per month (without VAT) Please?

    Thank you very much

    Phil Chandler

    Hello

    To update the VAT number in your Adobe account, you can please Contact Customer Care.

    * be sure that you are logged on the page with you Adobe i.d.

    Once the VAT number will be updated in your Adobe account, you cannot be attributed to the VAT of the next payment.

    Kind regards

    Sandrine

  • Is it possible to try the function "send for Signature" before ordering?

    Is it possible to try the function "send for Signature" before ordering?

    Hi daves.

    I'm sorry for the delay in answering your question. You are welcome to download a free trial of 30 days of Acrobat Pro DC, if you want to see how sending the Signature feature. You can download the trial from this page: Download Adobe Acrobat free trial version | Acrobat Pro DC.

    Best,

    Sara

  • Is it possible to call the function Document disinfect since a JavaScript?

    Hi, I hope that this should be easy, but a link back are not the results of the research in the SDK from Adobe live. Is it possible to call the functions Document disinfect or remove hidden information of in a javascript script? Here pointers would be GREATLY appreciated.

    This command opens the dialog window Document disinfect, but you will still need to run it manually, and you will also need to run it from a context of trust.

    app.execMenuItem("DIGSIG:SanitizeDocument")

  • Is it Possible to use a function when you create a table?

    Hello

    Is it possible to use a function during the construction of a table?

    I would like to browse my data returned from the db and call a function. The part where I call the function "myFunction [i]" doesn't seem to work. How can I solve this problem? I need to put the function call results in the table.

    var i: uint;

    for (i = 0; i < dataArray.Length; i ++)

    {

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}];

    }

    Thank you!
    -Laxmidi

    Hi laxmi,

    Yes of course it is quite possible to use a function when you create a table... In your code, you made some mistakes...

    You used hooks to call the function myFunction [i]... where you are supposed to use parentheses... myFunc (i)... and other you must push the object in the dgArray but yous hould not not attribute...

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}]; This will result in only the last table iterates in dgArray...

    So you should write dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});

    Check out the code below...


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete ="init (); » >

      private var dgArray:Array = new Array();
    private var myDataArray:Array = [{data: '1', name: 'Robert'}, {data: '2', name: 'Nicolas'}, {data: '3', name: "Bika"}]
     
    private function init (): void
    {
    for (var i: int = 0; i
    {
    dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});
    }
    }
      
    private void myFunction(i:int):String
    {
    Return 'Type' + i;
    }
    ]]>

    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • is it possible to preview an add-on before you change

    Is it possible to preview an add-on before adding I chose an addon and it changes automatically, but then I decide I don't like

    also, how can I get rid of an add on if you like it... the only way I have is to restore to the original and it's so hard

    You might consider trying the extension with a new profile or use the portable Firefox for such a case version, when you are not sure you want to keep the extension.

    Usually just uninstall the extension.

    Some extensions may make changes to the pref settings that are part of Firefox, and in this case you may need to reset those.

    Prefs added by the extension for its own use (usually extensions. < name >. *) can be removed by a reset on the topic: config page.

  • timeline plays twice before returning to the menu root

    Hello

    I've linked a timeline on its menu root,

    He playes twice before returning to it

    Amit

    I don't know what that means. By default, a calendar is created without any action on end. A timeline has a chapter which, by default, if you have not added any other chapters would be its first chapter.

    If you perform the action at the end of a timeline of its own chapter 1, it will play until the end and start again the chronology. I wonder what you have defined that it is up to the menu on the second go-around. Normally he would just keep looping.

  • Can I limit the number of lines of text entered into a TextArea?

    Hello

    I use Flex Builder 2 to create an application that allows users to enter text in different TextAreas and eventually create a PDF file with their different text. My only problem is that I can't limit the number of lines of text used in each text box. I can limit characters by using maxChar, but this does not take into account a user entering multiple presses "return" - this does not affect the character limit, but can result in the final PDF layout (spitting the text on page 2).

    Is there a way to keep track and limit the number of lines of text in a text box (in Flex 2)?

    (Ideally I won't disable the ability for users to use the 'back' button to create several paragraphs)

    Any help would be appreciated.

    Thank you

    Ben.

    Hello

    Try this code.

    import

     

    flash.events.KeyboardEvent;

    Import flash.events.TextEvent;

    Import mx.controls.TextArea;

    public class LimitedLinesTextArea extends TextArea {}

    private var numLinesAllowed:int = 0;

    private var moreCharsAllowed:Boolean = true;

    public function LimitedLinesTextArea():void

    {

    this.addEventListener (flash.events.TextEvent.TEXT_INPUT, textInputHandler);

    }

    override protected function keyDownHandler(event:KeyboardEvent):void

    {

    if (this. textField.numLines > numLinesAllowed)

    moreCharsAllowed =

    fake;

    on the other

    moreCharsAllowed =

    true;

    Super.keyDownHandler (event);

    }

    private function textInputHandler(event:TextEvent):void

    {

    If

    (! moreCharsAllowed)

    Event.preventDefault ();

    }

    public function the value numberofLines(value:int):void

    {

    numLinesAllowed = value;

    }

    }

  • date ranges - possible to use analytical functions?

    The following datastructure must be converted into a daterange datastructure.
    START_DATE END_DATE      AMMOUNT
    ---------- ---------- ----------
    01-01-2010 28-02-2010         10
    01-02-2010 31-03-2010         20
    01-03-2010 31-05-2010         30
    01-09-2010 31-12-2010         40
    Working solution:
    with date_ranges
    as   ( select to_date('01-01-2010','dd-mm-yyyy') start_date
           ,      to_date('28-02-2010','dd-mm-yyyy') end_date
           ,      10                                 ammount
           from   dual
           union all
           select to_date('01-02-2010','dd-mm-yyyy') start_date
           ,      to_date('31-03-2010','dd-mm-yyyy') end_date
           ,      20                                 ammount
           from   dual
           union all
           select to_date('01-03-2010','dd-mm-yyyy') start_date
           ,      to_date('31-05-2010','dd-mm-yyyy') end_date
           ,      30                                 ammount
           from   dual
           union all
           select to_date('01-09-2010','dd-mm-yyyy') start_date
           ,      to_date('31-12-2010','dd-mm-yyyy') end_date
           ,      40                                 ammount
           from   dual
          )
    select   rne.start_date
    ,        lead (rne.start_date-1,1)  over (order by rne.start_date) end_date
    ,        ( select sum(dre2.ammount)
               from   date_ranges dre2
               where  rne.start_date >= dre2.start_date
               and    rne.start_date <= dre2.end_date
             ) range_ammount
    from     ( select dre.start_date
               from   date_ranges dre
               union -- implicit distinct
               select dre.end_date + 1
               from   date_ranges dre
             ) rne
    order by rne.start_date
    /
    Output:
    START_DATE END_DATE   RANGE_AMMOUNT
    ---------- ---------- -------------
    01-01-2010 31-01-2010            10
    01-02-2010 28-02-2010            30
    01-03-2010 31-03-2010            50
    01-04-2010 31-05-2010            30
    01-06-2010 31-08-2010
    01-09-2010 31-12-2010            40
    01-01-2011
    
    7 rows selected.
    However, I would like to use an analytical function to calculate the range_ammount. Is this possible?

    Published by: user5909557 on July 29, 2010 06:19

    Hello

    Welcome to the forum!

    Yes, you can replace the scalar sub-queriy with a SUMMARY, like this:

    WITH  change_data   AS
    (
         SELECT     start_date     AS change_date
         ,     ammount          AS net_amount
         FROM     date_ranges
              --
        UNION
              --
         SELECT     end_date + 1     AS change_date
         ,     -ammount        AS net_amount
         FROM     date_ranges
    )
    ,     got_range_amount     AS
    (
         SELECT     change_date          AS start_date
         ,     LEAD (change_date) OVER (ORDER BY  change_date) - 1
                                     AS end_date
         ,     SUM (net_amount)   OVER (ORDER BY  change_date)
                                    AS range_amount
         FROM    change_data
    )
    ,     got_grp          AS
    (
         SELECT     start_date
         ,     end_date
         ,     range_amount
         ,     ROW_NUMBER () OVER ( ORDER BY        start_date, end_date)
               - ROW_NUMBER () OVER ( PARTITION BY  range_amount
                                         ORDER BY          start_date, end_date
                           )         AS grp
         FROM    got_range_amount
    )
    SELECT       MIN (start_date)     AS start_date
    ,       MAX (end_date)     AS end_date
    ,       range_amount
    FROM       got_grp
    GROUP BY  grp
    ,            range_amount
    ORDER BY  grp
    ;
    

    This should be much more effective.

    The code is longer than what you posted. It is largely because it includes consecutive groups with the same amount.
    For example, if you add this line the sample data:

    --
           union all
           select to_date('02-01-2010','dd-mm-yyyy') start_date
           ,      to_date('30-12-2010','dd-mm-yyyy') end_date
           ,      0                                 ammount
           from   dual
    

    The query that you posted the product:

    START_DAT END_DATE  RANGE_AMMOUNT
    --------- --------- -------------
    01-JAN-10 01-JAN-10            10
    02-JAN-10 31-JAN-10            10
    01-FEB-10 28-FEB-10            30
    01-MAR-10 31-MAR-10            50
    01-APR-10 31-MAY-10            30
    01-JUN-10 31-AUG-10             0
    01-SEP-10 30-DEC-10            40
    31-DEC-10 31-DEC-10            40
    01-JAN-11
    

    I suppose you want only a new production line where the changes of range_amount., it is:

    START_DAT END_DATE  RANGE_AMOUNT
    --------- --------- ------------
    01-JAN-10 31-JAN-10           10
    01-FEB-10 28-FEB-10           30
    01-MAR-10 31-MAR-10           50
    01-APR-10 31-MAY-10           30
    01-JUN-10 31-AUG-10            0
    01-SEP-10 31-DEC-10           40
    01-JAN-11                      0
    

    Of course, you can change the original query so that it did, but it would eventually just as complex as the above query, but less effective.
    Conversely, if you prefer the longer output, then you need not got_grp Tahina-query in the above query.

    Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.
    There are people who use this forum for years and have yet to be begged to do.

Maybe you are looking for