<p><pre><code>  &gt; Do you really look at every single piece of shared memory?
</code></pre>
Yes<p><pre><code>  &gt; When you inherit a large codebase from someone?
</code></pre>
If the codebase has lots of threading errors, then yes, it&#x27;s the only way. If it&#x27;s a large program, it can take months to go through and check every piece of shared memory (and removing threads along the way, removing shared stuff); but the alternative could take <i>years.</i><p>In one case, I moved every single lock&#x2F;unlock to the top of a file so I could quickly see all the locks and unlocks, and that each lock had a matching unlock, even in error conditions.