
On 3/8/2011 1:00 PM, Ted Byers wrote:
So, if I can answer a question with a question, is it not possible to always prevent deadlocks and race conditions by careeful analysis and use of the right suite of semaphores, or it is just that my experience with multithreading is too limited to have seen those cases where my approach is insufficient?
Oh, I completely agree with you. But sometimes, you just forget where the boundaries are in your application code, and well, then . . . . . My error that caused the deadlock was certainly something I never should have done, but it (as always) happened so rarely that it was hard to replicate (and in some cases, hard to notice, as it only locked two threads out of many). Likewise: I wouldn't run my application with STL iterator debugging enabled, but it's great during development for those occasional brain farts.