Operating Systems — Lecture 09
$ make run
fwrite 2048 records of 512 bytes time: 0.3 ms 0.14 us/record
write 2048 records of 512 bytes time: 0.8 ms 0.41 us/record
write O_DIRECT 2048 records of 512 bytes time: 40.8 ms 19.94 us/record
write O_DIRECT|O_SYNC 2048 records of 512 bytes time: 10511.3 ms 5132.49 us/record
Same bytes, same file, same disk: a factor of 35,000. All four were told “written”. What did each get?
A process talks to the outside through channels.
It holds a number.
The number is an index in its descriptor table.
The entry points to a channel in the kernel, which remembers how it was opened, where it is in the file, and which file it is.