
Hello, I am currently using boost::inteprocess locks for the windows platform. I've used both the named_recursive_mutex and the interprocess_recursive_mutex. Both implementations use the code below: inline void interprocess_mutex::lock(void) { do{ boost::uint32_t prev_s = detail::atomic_cas32((boost::uint32_t*)&m_s, 1, 0); if (m_s == 1 && prev_s == 0){ break; } // relinquish current timeslice detail::thread_yield(); }while (true); } One issue that I noticed was that if a thread crashes while holding the lock, all other threads stay blocked. If I rerun my process again, my process just hangs at the detail::atomic_cas32() which causes a deadlock. I've tried looking through all the other interprocess locks, and they all seem to filter down to this call. Can someone suggest a locking mechanism where I could lock a resource from all other processes, but if a process crashes that currently owns the lock, other threads will be allowed to acquire the lock? It seems like "file lock" might do what I want, but I wasn't to sure. any suggestions? thx, J