Re: New libc malloc patch

From: Jason Evans <jasone_at_canonware.com>
Date: Sat, 3 Dec 2005 13:08:51 -0800
On Dec 3, 2005, at 12:26 AM, David Xu wrote:
> I have a question about mutex used in the patch, you are using
> a spin loop, isn't it suboptimal ? and a thread library like  
> libpthread
> supports static priority scheduling, this mutex does not work, it
> will causes a dead lock, if a lower priority thread locked the mutex,
> and preempted by a higher priority thread, and the higher priority
> thread also calls malloc, it will spin there to wait lower
> priority thread to complete, but that will never happen.

David,

You are correct that this is a problem.  Thank you for pointing it  
out.  There's a new patch that uses the spinlocks that are provided  
by the threads libraries.  Please let me know if this looks okay.

Also, this patch removes/modifies the code that was causing build  
failures on amd64, so it's worth giving another try.  Hopefully, it  
will compile now...

http://www.canonware.com/~jasone/jemalloc/jemalloc_20051203a.diff

Thanks,
Jason
Received on Sat Dec 03 2005 - 20:10:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:48 UTC