On Sat, 10 Mar 2007, Vlad GALU wrote:

On 3/10/07, Kip Macy <[EMAIL PROTECTED]> wrote:
umtx

Is it safe/recommended to use spinlocks, like in jemalloc, for very small portions of code? I'm particularly interested in protecting writes to a couple of word sized ints on amd64, so the critical section wouldn't be longer than two assignments. Of course, I could use a lockless queue for my purposes, but I'm asking anyway.

I believe that the system malloc library is forced to use low level locking primitives because the pthread library depends on malloc. I would suggest using the pthread mutex primitives where at all possible. We might want to consider adding "adaptive" mutex support to the pthread libraries if we don't have it.

Robert N M Watson
Computer Laboratory
University of Cambridge
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to