Subj : Re: Recursive lock? To : comp.programming.threads From : Michel Date : Thu May 19 2005 08:09 pm doug wrote: > Yeah, we wrap them up. We do this because we write our code to an > 'isolation layer' api. We then write an isolation layer for each operating > system, mapping the api calls to the primitives supported on that machine. > > It's not the fastest way to do it, but it's portable, and in debug builds we > can add in code for things like: > - double acquires > - invalid frees > - high contention (lots of threads waiting for some lock) > - long holds (a thread holds a lock for a long time) > - hierarchy checking > > Means we don't have to touch the app code when we port. > Event though I work primarily in win32 land I wrap and isolate all apis as well, for a lot of the reasons you mention, and to get a C++/exception safe interface. Actually i don't see why It would hamper performance or be as fast as native, at least not when diagnostics is compiled away. But what typically does the wrapper do on double acquire (assert, throw) and what differences is there in debug and release builds? /Michel .