I am working on ddbmock project. Basically, this is a server reproducing Amazon’s DynamoDB API.
Even though this implementation does not involve threads directly, it is very likely to be run in multi-threaded environment and, at the moment, I know it has unpredictable “features” 🙂 All threads will work on the same store…
The first step will be to add mutex but how can I test that I missed none and the design is actually working ? Is there any reliable way ?
@martineau, the problem is not restricted to CPython. Anytime there is shared resources it can lead to concurrency problem.
One way is to avoid it altogether. Serialize everything and allow no concurrency. Given this is an in memory mock server this may be a reasonable restriction.
But if you do want to provide parallel access, the strategy I’d use is to stress test the system using a variety of request for a long period of time. This tend to shake out good number of race condition bugs. Otherwise I know of no reliable way to proof a program is free of concurrency bug.