Dat3M
Dat3M copied to clipboard
The CAAT Solver is not thread-safe
The following static fields are modified regularly and exhibit race conditions:
-
solvers.caat.constraints.AcyclicityConstraint.SET_COLLECTION_POOL -
solvers.caat.constraints.AcyclicityConstraint.TEMP_LIST -
solvers.caat.misc.PathAlgorithm.queue1andqueue2 -
solvers.caat.misc.PathAlgorithm.parentMap1andparentMap2
I recommend wrapping them with ThreadLocal.
Sure, that can be done. There are also two alternatives IIRC:
- Make them non-static, but it is not clear where to put those and how to pass them around properly.
- Just inline them as local variables into the functions that use them. All these variables only serve as temporarily reusable containers that "memorize" typical size requirements. There is likely not much performance degradation in making these local and reconstructing the data structure each time. For initial testing of multi-threaded CAAT, this should be fine.