Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

What is Core.Globals.RandomDispatcher ?

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

    What is Core.Globals.RandomDispatcher ?

    Hi there, I note that in several places in the documentation the code samples use "Core.Globals.RandomDispatcher" e.g:



    I've got some questions:

    What is Core.Globals.RandomDispatcher? - aside from the obvious that its some kind of Random dispatcher, can you be more specific?
    What kind of Dispatcher is it?
    Which pool of dispatchers is it using to choose the random one?
    When should I use RandomDispatcher rather than System.Threading.Dispatcher.Current?
    when should I use RandomDispatcher rather than ChartControl.Dispatcher / Chart.Dispatcher / ChartTrader.Dispatcher etc?

    Thanks,

    Kevin.

    #2
    Hello Kevin,

    Thanks for your post.

    NinjaTrader spawns as many UI threads (as well as instrument threads) as logical cores.

    Core.Globals.RandomDispatcher will select a random (to the user) UI thread.

    ChartControl.Dispatcher would use the UI thread associated with that chart window.

    You should use a specific dispatcher for when you need to modify something that would reside on that specific thread.

    RandomDispatcher would be used for assigning work to an available UI thread.

    Let us know if you have any questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks for the explanation Jim.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CortexZenUSA, Today, 12:53 AM
      0 responses
      1 view
      0 likes
      Last Post CortexZenUSA  
      Started by CortexZenUSA, Today, 12:46 AM
      0 responses
      1 view
      0 likes
      Last Post CortexZenUSA  
      Started by usazencortex, Today, 12:43 AM
      0 responses
      5 views
      0 likes
      Last Post usazencortex  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      168 responses
      2,265 views
      0 likes
      Last Post sidlercom80  
      Started by Barry Milan, Yesterday, 10:35 PM
      3 responses
      11 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X