Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2005 00:58:25 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Jason Evans <jasone@canonware.com>
Cc:        Johan Bucht <bucht@acc.umu.se>, current@freebsd.org
Subject:   Re: New libc malloc patch
Message-ID:  <Pine.GSO.4.43.0512120055020.22334-100000@sea.ntplx.net>
In-Reply-To: <9FAD2B4B-C167-42D7-A8E7-BE03F4C07543@canonware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 11 Dec 2005, Jason Evans wrote:

> On Dec 11, 2005, at 5:48 PM, Johan Bucht wrote:
>
> > * Locking primitive
> > The biggest issue and as David Xu pointed out is probably the locking
> > primitives. The SPINLOCK use has a limit in the threading library and
> > makes is hard to have a lot of mutexes. I ended up using a wrapper
> > around the umtx_lock function to get recursive mutexes and it would
> > probably be better to extend the umtx functions to handle recursion.
> > This would probably also be appreciated by other malloc
> > implementations.
> > Might be interesting to implement some of the ideas from the Linux
> > futex
> > implementation to help umtx.
>
> I have been contemplating creating a separate spinlock API that
> doesn't require the threads library to track the spinlocks across
> fork.  This would (if I understand correctly) remove the current
> static spinlock limitations.

What about using pthread_atfork()?

> As for supporting recursive spinlocks, I doubt that the overhead
> would be acceptable in general.  If I could get rid of the need for
> the one recursive lock in malloc.c, I certainly would. =)

Why do we need a recursive mutex?  Can you not restructure the
code so that it is not needed?

-- 
DE




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.43.0512120055020.22334-100000>