reduce some ridiculously large spin counts
authorRich Felker <dalias@aerifal.cx>
Sat, 7 May 2011 01:45:48 +0000 (21:45 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 7 May 2011 01:45:48 +0000 (21:45 -0400)
these should be tweaked according to testing. offhand i know 1000 is
too low and 5000 is likely to be sufficiently high. consider trying to
add futexes to file locking, too...

src/stdio/__lockfile.c
src/thread/__wait.c

index 4e0239e..66a4d26 100644 (file)
@@ -3,7 +3,7 @@
 
 void __lockfile(FILE *f)
 {
-       int spins=100000;
+       int spins=10000;
        int tid;
 
        if (f->lock < 0) return;
index d024fb3..041a066 100644 (file)
@@ -2,7 +2,7 @@
 
 void __wait(volatile int *addr, volatile int *waiters, int val, int priv)
 {
-       int spins=50000;
+       int spins=10000;
        if (priv) priv = 128; priv=0;
        while (spins--) {
                if (*addr==val) a_spin();