0

Say we have a | b, under what circumstances could b slow down a? If b was a CPU hog, that would do it...what if b was consuming stdin really slowly? are there other factors?

  • yes | tail -f /dev/null will slow down yes to a halt. yes > /dev/null will let if peg the cpu to 100%. Now you know under which circumstances that could happen. And no, b being a CPU hog won't slow a down if both are single-threaded and your system gives each of them its own CPU to hump on. – mosvy Jul 25 at 7:00
2

In general, if b was using resources (CPU, disk, memory, file descriptors etc.) that a also needed, or if b held any type of lock on files or in databases that a was trying to acquire, this would possibly slow down a (or even cause a to fail).

The a process would simply block while trying to write to b if b did not read what it was writing fast enough. This is, I believe, the more common scenario.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.