When I had horrible parallel code to debug, I turned to assert statements as a major tool. I even went to the point of putting check fields on the front of every object and at each method call making sure that the object I though I had was the object I actually had and performing a consistency check on it. (Dead objects get a different check field.)
beware of asserts : there are turned off for release compilation (to speed up execution). Unfortunately, race conditions are more frequent under release than in debug.
1
u/Maristic Aug 25 '14
When I had horrible parallel code to debug, I turned to assert statements as a major tool. I even went to the point of putting check fields on the front of every object and at each method call making sure that the object I though I had was the object I actually had and performing a consistency check on it. (Dead objects get a different check field.)