This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
significance of lock->__spinlock increment in spinlock.c?
- To: <libc-alpha at sourceware dot cygnus dot com>
- Subject: significance of lock->__spinlock increment in spinlock.c?
- From: Britton <fsblk at aurora dot uaf dot edu>
- Date: Mon, 18 Dec 2000 14:33:16 -0900 (AKST)
I have been trying to understand the thread code. On smp kernels, after a
failed spin, lock->__spinlock gets incremented like this:
lock->__spinlock += (spin_count - lock->__spinlock) / 8;
which amount to
lock->__spinlock += (lock->__spinlock * 2 + 10 - lock->__spinlock) / 8
I am just wondering what is the significance of the numbers used in this
increment, or where can I find out?
Thanks,
Britton