Date: Fri, 18 Apr 2003 10:51:45 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: Robert Watson <rwatson@freebsd.org> Cc: Daniel Eischen <eischen@pcnet1.pcnet.com> Subject: Re: libpthread patch Message-ID: <3EA03B31.A6D1D83E@mindspring.com> References: <Pine.NEB.3.96L.1030418063854.24445U-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote: > On Fri, 18 Apr 2003, Terry Lambert wrote: > > You are allowed to recurse on a mutex in the kernel, because there's > > some depth to code paths that shouldn't be there, but it's easier to > > allow recursion than it is to correct the code. > > By default, mutexes are not permitted to be recursed, and recursing them > will cause a panic. Recursion is only permitted if the MTX_RECURSE flag > is set at mutex initialization time, which is strongly discouraged. I should have said that "the potential is there, and it's used". The best way to discourage recursion, of course, is to remove the capability. I wish you had commented on the issue of introducing hierarchy into lock acquisition; witness effectively enforces the first hierarchy that occurs, thereafter, but only on a per locking entity basis, and not in the circumstances I described, e.g.: acquire: mutex1(a) mutex2 mutex1(b), release mutex1(a). -- Terry
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EA03B31.A6D1D83E>