Pseudo-pipelines
On single-tasking operating systems, the processes of a pipeline have to be executed one by one in sequential order; thus the output of each process must be saved to a temporary file, which is then read by the next process. Since there is no parallelism or CPU switching, this version is called a "pseudo-pipeline".
For example, the command line interpreter of MS-DOS ('COMMAND.COM') provides pseudo-pipelines with a syntax superficially similar to that of Unix pipelines. The command "dir | sort | more" would have been executed like this (albeit with more complicated temporary file names):
- Create temporary file 1.tmp
- Run command "dir", redirecting its output to 1.tmp
- Create temporary file 2.tmp
- Run command "sort", redirecting its input to 1.tmp and its output to 2.tmp
- Run command "more", redirecting its input to 2.tmp, and presenting its output to the user
- Delete 1.tmp and 2.tmp, which are no longer needed
- Return to the command prompt
All temporary files are stored in the directory pointed to by %TEMP%, or the current directory if %TEMP% isn't set.
Thus, pseudo-pipes acted like true pipes with a pipe buffer of unlimited size (disk space limitations notwithstanding), with the significant restriction that a receiving process could not read any data from the pipe buffer until the sending process finished completely. Besides causing disk traffic, if one doesn't install a harddisk cache such as SMARTDRV, that would have been unnecessary under multi-tasking operating systems, this implementation also made pipes unsuitable for applications requiring real-time response, like, for example, interactive purposes (where the user enters commands that the first process in the pipeline receives via stdin, and the last process in the pipeline presents its output to the user via stdout).
Also, commands that produce a potentially infinite amount of output, such as the yes command, cannot be used in a pseudo-pipeline, since they would run until the temporary disk space is exhausted, so the following processes in the pipeline could not even start to run.
Read more about this topic: Pipeline (software)