0

I am reading about caching and buffering from Operating System Concepts, and here is a copy of it.

  1. Is it correct that cache is used only for reading not for writing?

    Is buffer used only for writing (my original understanding), or can it be used for both reading and writing (seems to be what the book means)?

  2. There is cache coherence problem for caches.

    Is there a similar/dual problem for buffers?

Thanks.

1
  1. Caches are used for reading and writing; see the various write policies which can be used for caches.

    Buffers are also used for reading and writing. “Buffer” is a rather overloaded term and has different meanings in different contexts, so you’ll see different definitions in different places.

  2. Yes, you can end up with writes going to a buffer, then reads directly from the underlying device, or writes going directly to the underlying device, before the buffer is flushed to the device. Direct reads will show stale data, direct writes will be lost when the buffer is flushed.

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.