Which of the following statements is/are true about buffering of the operating…

2022

Which of the following statements is/are true about buffering of the operating systems?
(i) A buffer is a special register.
(ii) One reason of buffering is to come with speed mismatch between the producer and consumer of the data stream.

Answer: B. Only (ii)Concept. In an operating system a buffer is an area of memory — in main memory, or in a device controller’s own memory — that temporarily holds data while it…

  1. A.

    Only (i)

  2. B.

    Only (ii)

  3. C.

    Both (i) and (ii)

  4. D.

    Neither (i) nor (ii)

Attempted by 829 students.

Show answer & explanation

Correct answer: B

Concept. In an operating system a buffer is an area of memory — in main memory, or in a device controller’s own memory — that temporarily holds data while it is being moved between two parties. It is storage the operating system allocates and refers to by a memory address; it is not a named hardware register inside the CPU. Buffering is introduced whenever the two ends of a transfer cannot proceed in lockstep.

The three classical reasons an operating system buffers:

  • Speed mismatch — the producer of a data stream and its consumer run at different rates, so the buffer absorbs the difference instead of forcing the fast side to wait on every byte (a slow modem feeding a fast disk is the textbook case).

  • Transfer-size mismatch — the two sides move data in different units, so the buffer holds a large block while it is fragmented into small packets, or reassembles small packets into a large block.

  • Copy semantics — the data the application had at the moment it issued the write is copied into kernel space, so a later change by the application cannot alter what is actually written out.

Application to the two statements.

  1. Statement (i) says a buffer is a special register. A register is a small, fixed storage cell inside the CPU datapath, named directly by the instruction set. A buffer is an addressable block of memory whose size is chosen by software — a disk block of a few kilobytes, a network buffer, a video stream buffer of several megabytes — quantities no register can hold. The statement names the wrong class of storage.

  2. Statement (ii) says one reason of buffering is to cope with a speed mismatch between the producer and the consumer of the data stream. That is exactly the first reason listed above, and it is the standard textbook justification for buffering. The statement is accurate.

Cross-check — register versus buffer.

Property

Register

Buffer

Where it lives

Inside the CPU datapath

Main memory or device memory

Size

A few bytes, fixed by the instruction set

Chosen by software: bytes to megabytes

Referred to by

A name in the instruction set

A memory address

Typical job

Holding an operand during an instruction

Holding a data stream between producer and consumer

Every property in the right-hand column matches how buffering is described and used, and none of them fits a register. So statement (i) is false and statement (ii) is true: only (ii) holds.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…