Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi thread read / write

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

    Multi thread read / write

    I am exchanging information between two different strategies by writing the info to a file from the first strategy and reading the same infor from that file in the second strategy. Because NT is multi threading there is a change of conflict between reading and writing at the same time from the same file. Is there a way to prevent writing and reading at the same time, it should be sequential.

    Kind regards,
    Rene

    #2
    Hello,

    Please review our Help Guide on Multi-Thread considerations:



    Here is a thread on this topic where some users offer some suggestions on how to handle this:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by Renejm View Post
      I am exchanging information between two different strategies by writing the info to a file from the first strategy and reading the same infor from that file in the second strategy. Because NT is multi threading there is a change of conflict between reading and writing at the same time from the same file. Is there a way to prevent writing and reading at the same time, it should be sequential.

      Kind regards,
      Rene
      You will need a mutex if you want to force sequential write before read, and have the writer signal the reader when it finishes writing.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      630 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      566 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X