Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create new thread for each Account.CreateOrder

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

    Create new thread for each Account.CreateOrder

    Hello,

    I am working on a script to submit an order to multiple accounts simultaneously in a loop. i.e.

    foreach (Account myAccount in MyAccoutList)
    {
    submitTheAccount(myAccount);
    }

    Will it be more efficient to start a new thread for each submitTheAccount call like this?

    foreach (Account myAccount in MyAccoutList)
    {
    Thread thread =new Thread(() =>submitTheAccount(myAccount));
    thread.Start();​
    }​

    Which way is recommended?

    #2
    Hello coppernob108,

    Threading is handled internally, we do not suggest using custom threading in Ninjascript to maintain the order of events the platform expects.

    Comment


      #3
      Hi Jesse,

      Thanks for the input.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      110 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      59 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      37 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      41 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      78 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X