33 ms·
> As a side note, I think the shell script version would have been multicore friendly, at least up to six cores. That's not how the sort command, in lines 3 an
by pascal_cuoq 11y ago
> As a side note, I think the shell script version would have been multicore friendly, at least up to six cores.
That's not how the sort command, in lines 3 and 5, works.
- regularfry 11y agoIt is how pipelines work, though. 6 commands, 6 processes all started at once. They're each allowed a core to themselves, if the kernel deems it so.
- davidshepherd7 11y agoBut `sort` has to read all the input before writing any output (I think...). So you get some parallelism but not as much as you might hope.
- lisper 11y agoThat's true, but it doesn't really count if only one of the threads is eligible to run at any one time and all the others are blocked.