Re: [PATCH] sort: Add --threads option, which parallelizes internal sort
From:
Jim Meyering
Subject:
Re: [PATCH] sort: Add --threads option, which parallelizes internal sort.
Date:
Sun, 18 Oct 2009 20:16:18 +0200
Chen Guo wrote:
> In my last patch submission I noted while sorting in LC_ALL the endline
> characters of a couple of lines would be randomly cut off. The cause was
> memcoll being not threadsafe, I've since included a workaround.
...
> + /* If singlethreaded, the merge uses the memory optimization
> + suggested in Knuth exercise 5.2.4-10; see sortlines. */
> + size_t bytes_per_line = 3*sizeof (struct line);
> + - (1 < nthreads ? 0 : sizeof (struct line)*3/2);
I nearly forgot to point out the above.
There's a stray semicolon.