> > > On FreeBSD and OS X, the underlying pthread_mutex can already do deadlock > detection, so I don't see why you'd need to add another word. The > PTHREAD_MUTEX_ERRORCHECK attribute has been part of POSIX since 1997, so > I'd expect it to be supported everywhere. >PTHREAD_MUTEX_ERRORCHECK detects the deadlock that already happened. tsan's deadlock detector (as well as helgrind and many other similar tools) detects lock order inversion, i.e. a situation which may potentially lead to a deadlock. --kcc -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140609/ca54f5c5/attachment.html>
On 9 Jun 2014, at 10:19, Kostya Serebryany <kcc at google.com> wrote:> tsan's deadlock detector (as well as helgrind and many other similar tools) detects lock order inversion, i.e. a situation which may potentially lead to a deadlock.Yes, that's what WITNESS does in the FreeBSD kernel. The line after the one you quoted mentioned the port of this to userspace pthreads. David
On Mon, Jun 9, 2014 at 1:21 PM, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:> On 9 Jun 2014, at 10:19, Kostya Serebryany <kcc at google.com> wrote: > > > tsan's deadlock detector (as well as helgrind and many other similar > tools) detects lock order inversion, i.e. a situation which may potentially > lead to a deadlock. > > Yes, that's what WITNESS does in the FreeBSD kernel. The line after the > one you quoted mentioned the port of this to userspace pthreads. >Did it extend the pthread_mutex_t data structure?> > David > > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140609/8aef7ac0/attachment.html>