Subject: CVS commit: src/lib/libpthread
To: None <source-changes@NetBSD.org>
From: Andrew Doran <ad@netbsd.org>
List: source-changes
Date: 09/07/2007 00:07:55
Module Name: src
Committed By: ad
Date: Fri Sep 7 00:07:55 UTC 2007
Modified Files:
src/lib/libpthread: pthread_lock.c
Log Message:
If a libpthread internal spinlock is held, nanosleep() for a tick instead of
yielding. This is a nasty band-aid but with many threads, looping over
sched_yield() wastes a huge amount of CPU time. It would be nice to have a
way to temporarily disable preemption, but it turns out that's yet another
no-brain concept that has been patented and the patent holder seems to be
suing people lately. Another alternative is probably to have kernel-assisted
spinlocks.
To generate a diff of this commit:
cvs rdiff -r1.24 -r1.25 src/lib/libpthread/pthread_lock.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.