:: [DNG] Piping is an easy way to do m…
Góra strony
Delete this message
Reply to this message
Autor: Steve Litt
Data:  
Dla: dng
CC: jonhall80
Stare tematy: Re: [DNG] mouse driver question
Temat: [DNG] Piping is an easy way to do multithreading: was mouse driver question
Antony Stone said on Sat, 23 Apr 2022 23:55:36 +0200

>On Saturday 23 April 2022 at 22:57:12, Florian Zieboll via Dng wrote:


>I just tried several successive searches for a few unique filenames in
>a directory tree (all files in the same directory, just in case the
>position made a difference).
>
>The first search took 6 minutes and clearly set up some cache of
>results, because subsequent searches were consistently:
>
>    find . | grep filename : 20 seconds

>
>    find . -name filename : 25 seconds

>
>That was consistent no matter whether the two filenames were the same,
>or different but still in the same directory, and no matter which
>command was run first.
>
>Nice observation.


This makes sense. More than 15 years ago, I attended a talk by Jon
"maddog" Hall, in which he made the point that Unix piping was one of
the easiest ways to get multithreading, and that, if possible, each
process in the pipeline will get its own processor core (or nowadays,
thread). Unix piping is a great way to actually use all those CPU
threads.

SteveT

Steve Litt
March 2022 featured book: Making Mental Models: Advanced Edition
http://www.troubleshooters.com/mmm