Announcement

Collapse
No announcement yet.

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.

    Comment


      #3
      Thanks for the explanation Jim.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      49 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X