--- /tmp/linuxthreads/spinlock.c Fri Feb 9 11:04:08 2001 +++ spinlock.c Tue Apr 3 14:07:41 2001 @@ -78,7 +78,9 @@ if (__pthread_smp_kernel) { int max_count = lock->__spinlock * 2 + 10; - + if(max_count > MAX_ADAPTIVE_SPIN_COUNT) + max_count = MAX_ADAPTIVE_SPIN_COUNT; + for (spin_count = 0; spin_count < max_count; spin_count++) { if (((oldstatus = lock->__status) & 1) == 0) { if(__compare_and_swap(&lock->__status, oldstatus, oldstatus | 1)) --- internals.h Fri Feb 9 11:04:08 2001 +++ internals.h Tue Apr 3 14:05:53 2001 @@ -333,7 +333,7 @@ THREAD_SELF implementation is used, this must be a power of two and a multiple of PAGE_SIZE. */ #ifndef STACK_SIZE -#define STACK_SIZE (2 * 1024 * 1024) +#define STACK_SIZE (128 * 1024) #endif /* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */ @@ -395,6 +395,10 @@ #endif #ifndef WRITE_MEMORY_BARRIER #define WRITE_MEMORY_BARRIER() MEMORY_BARRIER() +#endif + +#ifndef MAX_ADAPTIVE_SPIN_COUNT +#define MAX_ADAPTIVE_SPIN_COUNT 100 #endif /* Max number of times we must spin on a spinlock calling sched_yield(). --- /tmp/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Fri Jun 9 13:17:35 2000 +++ ./sysdeps/unix/sysv/linux/bits/local_lim.h Wed Mar 21 17:34:55 2001 @@ -64,7 +64,7 @@ /* The number of threads per process. */ #define _POSIX_THREAD_THREADS_MAX 64 /* This is the value this implementation supports. */ -#define PTHREAD_THREADS_MAX 1024 +#define PTHREAD_THREADS_MAX 4096 /* Maximum amount by which a process can descrease its asynchronous I/O priority level. */