Re: bug#7489: [coreutils] over aggressive threads in sort

2010-11-29 Thread Paul Eggert
On 11/28/10 23:14, DJ Lucas wrote: http://lists.gnu.org/archive/html/coreutils/2010-11/msg00124.html Ah, sorry, I didn't understand that message and thought Pádraig had handled it. On an 8-core RHEL 5.5 x86-64 host I reproduced the problem with the stated test case: (for i in $(seq 12); do

Re: bug#7489: [coreutils] over aggressive threads in sort

2010-11-29 Thread Jim Meyering
Paul Eggert wrote: Could you please try this little patch? It should fix your problem. I came up with this fix in my sleep (literally! I woke up this morning and the patch was in my head), but haven't had time to look at the code in this area to see if it's the best fix. Clearly there's

bug#7489: [coreutils] over aggressive threads in sort

2010-11-29 Thread Pádraig Brady
On 29/11/10 07:14, DJ Lucas wrote: On 11/27/2010 08:18 PM, DJ Lucas wrote: lfs [ /lfs-source-archive/coreutils-8.7-new/src ]$ cat /lfs-source-archive/cracklib-words-20080507 | sort -u /dev/null; echo $? 0 lfs [ /lfs-source-archive/coreutils-8.7-new/src ]$ Appears to work as expected.

bug#7489: [coreutils] over aggressive threads in sort

2010-11-29 Thread Paul Eggert
On 11/28/10 23:14, DJ Lucas wrote: http://lists.gnu.org/archive/html/coreutils/2010-11/msg00124.html Ah, sorry, I didn't understand that message and thought Pádraig had handled it. On an 8-core RHEL 5.5 x86-64 host I reproduced the problem with the stated test case: (for i in $(seq 12); do

bug#7489: [coreutils] over aggressive threads in sort

2010-11-29 Thread Chen Guo
Hi all, On Mon, Nov 29, 2010 at 11:16 AM, Paul Eggert egg...@cs.ucla.edu wrote: entirely and use mutexes instead.  Perhaps a better fix would be to use mutexes at the top level (where threads can write to a file and therefore can wait) and to use spin locks at lower levels (where threads are

bug#7489: [coreutils] over aggressive threads in sort

2010-11-29 Thread Paul Eggert
On 11/29/10 16:34, Chen Guo wrote: The only way this would work is if, when a struct is locked via mutex the only threads trying to acquire the struct are trying to do so via mutex, and no threads are looking to lock via spinlock. Yes, that's definitely the idea. Under either of my