Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The calling thread cannot access this object because a different thread owns it.

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

    #16
    Originally posted by NinjaTrader_Brett View Post
    Problem is not one thread is used in the majority of situations.

    OnBarUpdate, OnStateChanged, OnMarketData, OnMarketDepth is all multi-threaded. Sure the render call is the only one thats not but its better to freeze then have the majority of clients run into intermittent issues is current thinking.
    Brett,

    I agree, you need something, I had been chasing this bug for about 8 days! A compiler failure or atleast a warning or log error, something is required to notify the coder of a Multi-Tasking error.

    After I thought I got them all, I found another Brush used deeper in the code, a compile warning or failure would have helped.

    Comment


      #17
      Originally posted by NinjaTrader_Brett View Post
      Problem is not one thread is used in the majority of situations.

      OnBarUpdate, OnStateChanged, OnMarketData, OnMarketDepth is all multi-threaded. Sure the render call is the only one thats not but its better to freeze then have the majority of clients run into intermittent issues is current thinking.
      Brett, your statement is a bit ambiguous. There is a difference between the various events each potentially running on a different thread each, and each of them running on multiple threads.

      In the former situation, scope considerations would mean that a brush defined in one event would not be available outside it anyway, and if each event is running on a single thread (albeit a different thread from the other events), then, again, Freeze()ing may need to be optional. Of course, if the latter is the case, then you are absolutely correct.

      Regardless, it might be useful to have a warning if any brush is not Freeze()d. I am just not sure that an enforced compilation failure is the correct solution. Any brush declared in class scope, on the other hand, should probably be mandatorily Freeze()d, and so result in an enforced compilation failure.

      Comment


        #18
        Never said compilation ( I think that was incorrectly pulled from another poster). Will just be a runtime exception caught and logged just like any other exception occurring in a NS object so we are consistent with how we handle.

        Comment


          #19
          Originally posted by NinjaTrader_Brett View Post
          Never said compilation ( I think that was incorrectly pulled from another poster). Will just be a runtime exception caught and logged just like any other exception occurring in a NS object so we are consistent with how we handle.
          Ah! Excuse my stupidity, please.

          Comment


            #20
            Originally posted by NinjaTrader_Brett View Post
            Went though this with Development and Product Management team was just educated that yes we should be Freezing brushes due to the multi-threaded nature of NinjaTrader.

            This has impact with DrawingTools, Setting Plots, Setting Lines, and OnRender method.

            I will start adding documentation this week to make this more clear, thanks guys for running through this.
            Brett,

            I am sure you guys are on this, but just wanted to post PENs should be frozen as well. They are based upon the Freezable class as well.

            Comment


              #21
              Yep. Thanks.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by gentlebenthebear, Today, 01:30 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Aviram Y, Today, 05:29 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by cls71, Today, 04:45 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by TradeForge, Today, 02:09 AM
              1 response
              22 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by elirion, Today, 01:36 AM
              2 responses
              14 views
              0 likes
              Last Post elirion
              by elirion
               
              Working...
              X