ArjunVachhani / order-matcher

simple, fast and feature rich order matching engine supports limit, market, stop-loss, iceberg, IOC, FOK, GTD orders
MIT License
137 stars 70 forks source link

matcher multithreading AddOrder supporting #29

Closed avatar-92 closed 3 years ago

avatar-92 commented 3 years ago

Is it correct to execute AddOrder from multiple threads in parallel or I should use locks for single thread work (execute AddOrder successively)?

ArjunVachhani commented 3 years ago

AddOrder, CancelOrder and CancelExpiredOrder are not thread safe and must be called sequentially.

avatar-92 commented 3 years ago

Is the matcher ready for a production environment? Do you use it in your projects?

ArjunVachhani commented 3 years ago

@avatar-92 I don't have any projects related to exchange/matching engine, so we are not using it. I have not found any bug at the moment. Feel free to raise issue if you find any.

Code in this repository is distributed under MIT license. Please read the license at MIT license

avatar-92 commented 3 years ago
  1. Can you add comments into class Order for clearify what properties I should set for add market/limit order?
  2. State is CurrentOrders in MatchingEngine. I should save CurrentOrders, and add it after restart matcher. Is it true?
avatar-92 commented 3 years ago

I found MatchingEngineTests. Will see it for clearify,