sort: use mutexes, not spinlocks (avoid busy loop on blocked output)
authorChen Guo <chenguo4@ucla.edu>
Mon, 6 Dec 2010 08:15:42 +0000 (00:15 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 Dec 2010 08:29:13 +0000 (00:29 -0800)
commit621876ff446885d32922f34681790581c994f9a5
treee279f95ce07f9d267e14a8e09f79ae31622e3f02
parent195c455d0ae3884ab2d9680ac3043aa36e9c8c3d
sort: use mutexes, not spinlocks (avoid busy loop on blocked output)

Running a command like this on a multi-core system
  sort < big-file | less
would peg all processors at near 100% utilization.
* src/sort.c: (struct merge_node) Change member lock to mutex.
All uses changed.
* tests/Makefile.am (XFAIL_TESTS): Remove definition, now that
this test passes once again.  I.e., the sort-spinlock-abuse test
no longer fails.
* NEWS (Bug reports): Mention this.
Reported by DJ Lucas in http://debbugs.gnu.org/7489.
NEWS
src/sort.c
tests/Makefile.am