From Putrid Gibbon, 4 Years ago, written in Python.
  1.  
  2. if io.type = read:
  3.     if not io.block in cache:
  4.         cache[io.block] = fs.read(io.block)
  5.     return cache[io.block]
  6. elif io.type = write:
  7.     if io.block in cache:
  8.         if io.data == cache[io.block]:
  9.             continue # return immediately, no need to re-write same data
  10.     cache[io.block] = io.data
  11.  
  12. # psuedo code in <>
  13. <every 10 seconds>
  14.     for iop in cache:
  15.         if iop.type = write:
  16.             fs.write(iop.block, iop.data)
captcha