Drop PTHREAD__NSPINS back from 1000 to 64. Setting the waiters bits and

preparing to sleep on a mutex are slow in relative terms, so this allows
us to recover from short lock holds without blocking, while not wasting
too much time on longer holds.
This commit is contained in:
ad 2007-10-04 21:04:32 +00:00
parent 366f52110b
commit 5059087834
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pthread_lock.c,v 1.30 2007/09/24 13:56:42 ad Exp $ */
/* $NetBSD: pthread_lock.c,v 1.31 2007/10/04 21:04:32 ad Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: pthread_lock.c,v 1.30 2007/09/24 13:56:42 ad Exp $");
__RCSID("$NetBSD: pthread_lock.c,v 1.31 2007/10/04 21:04:32 ad Exp $");
#include <sys/types.h>
#include <sys/lock.h>
@ -56,7 +56,7 @@ __RCSID("$NetBSD: pthread_lock.c,v 1.30 2007/09/24 13:56:42 ad Exp $");
#include "pthread_int.h"
/* How many times to try acquiring spin locks on MP systems. */
#define PTHREAD__NSPINS 1024
#define PTHREAD__NSPINS 64
static void pthread_spinlock_slow(pthread_spin_t *);