Old Feb 23, 19, 5:31 am
Join Date: Dec 2008
Location: Hands of Fate
Programs: MR LT(!)TE, DL PM MM, HTZ PC, 2V Fanboi, CBP GE, Uber Gold
Posts: 4,823
Originally Posted by sdadept View Post
I can't say too much, but having intimate knowledge of how the reservation code works, this is impossible. The inventory column is briefly locked while a reservation is made. First one in wins.
I don't think you have to worry about disclosing proprietary information here, this is how any well written inventory management system (and any ACID compliant database system) will work. When attempting to update inventory, a write lock must be obtained on the inventory counter (and only one request can hold a write lock at any given time), then the value of the counter is verified (this is where Z might now = 0 if an almost simultaneous sale were to take place), then the value of the counter is updated, then the write lock is released and the sale processed.
bennos is offline