Which programs benefit from applying the batching strategy


Problem

This problem concerns a simple pipeline program1 | program2. Assume that all important file I/O in the pipeline takes place over the pipe itself, meaning that any other file I/O (like error printouts) has no impact on performance. (Perhaps program1 generates its output computationally-e.g., by printing a list of numbers from 0 to 1 billion-and program2 counts the number of bytes in its standard input.)

Question I

Which programs in this pipeline might benefit from applying the prefetching strategy to its file I/O, program1, program2, both, or neither?

Question II

Which programs might benefit from applying the batching strategy to its file I/O, program1, program2, both, or neither?

Question III

Which programs might benefit from applying the write coalescing strategy to its file I/O, program1, program2, both, or neither? Explain briefly.

Question IV

If program1 and program2 both use standard I/O, then three file I/O caches might be relevant to the performance of the program1 | program2 pipeline: program1's stdio cache, the kernel's pipe buffer, and program2's stdio cache.
Describe an access pattern where all of these caches are helpful-in other words, where removing any of these caches would likely slow down the pipeline.

Example access patterns might include "sequential byte I/O", meaning program1 writes one byte at a time to stdout and program2 reads one byte at a time from stdin; and "sequential 512-byte block writes and sequential byte reads", meaning program1 writes 512 bytes at a time to stdout and program2 reads one byte at a time from stdin. An access pattern might also specify that a program pauses for some amount of time and/or flushes its write cache between its I/O accesses.

Question V

Describe an access pattern where program1's stdio cache is helpful, but program2's stdio cache is irrelevant to performance.

Question VI

Describe an access pattern where the kernel's pipe buffer is irrelevant to performance, or explain why such an access pattern is unlikely to exist.

Question VII

Reverse sequential I/O is not possible when reading or writing a pipe. Why not?

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Which programs benefit from applying the batching strategy
Reference No:- TGS03275813

Expected delivery within 24 Hours