Announcement

Collapse
No announcement yet.

setComputeOnClose question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • setComputeOnClose question

    Hi,

    I want to ask, if anyone could help, what will happen if I want main() to be triggered for every tick (setComputeOnClose=false), and the main() does not finish when the next tick comes in?

    Clement

  • #2
    Each and every tick coming into your EFS is sequential in nature. main() is not going to get called again until it has already returned from processing the current tick.

    Comment


    • #3
      Thanks Steve.

      Then is there any way that can tell whether my main() is still running when next tick comes in?

      Is it OK to use the profiler for analysis? Or is there any better way?

      Clement

      Comment


      • #4
        Do you think your script is somehow freezing and is no longer processing incoming ticks?

        If so, you could create a global counter, increment it and then like every 50th call (or 100th, etc) you print out a debug statement.


        PHP Code:
        var counter 0;
        function 
        main()
        {
          if (
        isLastBarOnChart())
          {
              if (
        counter 50 == 0)
              {
                   
        debugPrintln("counter = " counter);
              }
              
        counter++;
           }

        Comment


        • #5
          Steve,

          Thanks for your help.

          I can see that your script can tell whether main() is running or not. Am I correct?

          But my question is, suppose my main is so big that it takes 10ms to finish. When a tick comes in, main() is called.

          But the second ticks comes only 5ms later than the first tick. Now the main() due to the first tick is still running, and it will take another 15ms before it can handle the second tick.

          In this case, how can I know that my second tick is processed in a delayed time frame?

          Clement

          Comment


          • #6
            You will not have 2 threads of execution running your main() function at the same time. It is not possible for one invocation of main() (by the eSignal charting application) to overlap a 2nd one just because your main is too slow processing something. The main()'s off all your EFS's tied to one chart run sequentially through 1 thread of execution.

            What you think may happen will never happen. You are trying to approach this as though eSignal is a true real-time system and it's not. If your EFS is super slow, then you're going to cause an overall slowdown in eSignal's abililty to efficiently process your EFS's and show accurate results as they relate to the real-time data.

            [Just because eSignal throws around the word "real-time", it certainly doesn't mean that it's a "real-time application" in the computer science definition of the term. I can assure you that with 4.5 years of commercial level real-time flight simulator programming experience it is not.]
            Last edited by SteveH; 03-23-2011, 07:13 AM.

            Comment

            Working...
            X