0

I've learned about three solutions to Reader's Writer's Problem.

Considering the time efficiency, I think three of them are all usable in modern OS file system.

I'd like to get some clarification on how linux handles this problem. (NO ONE made a question about this before!)

For example, if the accesses are like, R R W R R, how does linux order these access?

  1. (R R ) W (R R) / no starvation (sol 3)
  2. (R R R R ) W / reader preference
  3. (R) (R) (W) (R) (R) / once at a time

Thank you!

  • 1
    I'm not sure I understand the question, but I don't think Linux has any specific I/O scheduling like this. – Barmar Oct 11 '21 at 16:03
  • Note: you may get "generic OS", like you learn in books (so to get an idea: you need it for next). But "Linux" has many heuristics and special cases, and so you should check the source to get the real implementation, and possibly you need to read past mailing list and kernel sites to get background of some changes. Maybe you can ask here the problem you see on interpreting the sources. Note: it depends on priority and on drivers (old hardware was like you describe, new hardware can do scattered reads and writes in one command). – Giacomo Catenazzi Oct 12 '21 at 06:37
  • This also may vary from file system to file system, or be tuneable. IMHO this question is too broad for stackoverflow. – Robert Oct 14 '21 at 15:16
  • I really appreciate all of you! Thank you for your comments! As you see, since I am kinda newbie in OS, I could not get what to study before your comments. Thank you again and hope you have fun! – Woody.P Oct 15 '21 at 16:35

0 Answers0