Updated 11/12/23
Updated 11/12/23
A simple and effective locking scheme is to place an operating system "lock" around every critical piece of code. If you have too much going on though the locks will get "hot" and the entire test platform will run slowly.
If a row needs to be locked for a while, a row lock can be used. A row lock has you designate a column to manage concurrency (say, the RowStatus column). The value of the RowStatus column indicates whether the row is allocated to a specific thread / process: ("<something>" = allocated) or not ("" = "free"). The threads / processes must use a convention to atomically allocate and free the row. See routine "Background.allocateAnAnimal" in animalFarm_02 for an example.
Testing Complex Systems
Copyright © 2023 Testing Complex Systems - All Rights Reserved.
Powered by GoDaddy
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.