apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject Re: Thoughts on locks
Date Tue, 26 Jun 2001 17:59:30 GMT
On Tue, Jun 26, 2001 at 10:49:42AM -0700, Brian Pane wrote:
> Please forgive me if this issue has been covered previously, but
> I've been wondering lately about whether it would be useful to
> add support for lightweight spin-locks as  a complement to the
> current intraprocess locks in APR.  There are some places, like
> the pool memory allocator, where a spinlock might perform better
> than a pthread mutex.  Thoughts?

Well, I just about to write a message saying that we ought to remove the
mutexes from the pool memory allocator code ANYWAY.  AFAICT, the pool
only needs to be locked when the pool is shared across workers - which 
only seems to be the case with the global or child pool.  Locking the
pool should be the exception, not the norm.  What Cliff just suggested
about APR_XTHREAD sounds like it could apply to the pool as well.

As far as spinlocks go, can these be done in a crossplatform way?  The
issue is that we need an atomic operation to do the spinlock in.  
-- justin


Mime
View raw message