CS FundamentalsHardGATE CS
Writes of at most PIPE_BUF bytes to a pipe have which guarantee when several writers share the pipe?
- A. They are atomic: the bytes of one such write are not interleaved with bytes from other writers
- B. They are delivered in the reverse order
- C. They are guaranteed to be on disk
- D. They never block
Correct answer: A. They are atomic: the bytes of one such write are not interleaved with bytes from other writers
POSIX requires writes of up to PIPE_BUF bytes (at least 512, 4096 on Linux) to be atomic; larger writes may be interleaved with other writers' data.
More Operating Systems questions
- A process reads a file sequentially, and the OS detects this. Which buffer-cache policy is most appropriate?
- Which statement about the unified buffer cache (page cache shared by mmap and read/write) is correct?
- A log-structured file system (LFS) writes all modifications sequentially to a log. What is its main background cost?
- Why do SSDs need the TRIM command and wear levelling, unlike hard disks?
- For an SSD, which disk-scheduling algorithm is usually chosen by the OS (e.g. Linux 'none' or 'noop'), and why?
- A RAID 5 array of 5 disks loses one disk. During the rebuild, which statement is correct?