Operating System: Chapter 10 Homework

10.2 只有保持一個central open-file table,才能在刪除file時確定已經沒有process在存取這個file了。另外不同的process存取同一個file時會有不同的states,會存取不同的location,這需要不同的entries來記錄。

10.3 Sometimes it's fine for multiple processes to concurrent access to a file. The mandatory locks would limit the flexibility. 不同的程式可能可以容忍同時存取同一個file。其他program structures可能可以保證mutal exclusion例如說memory locks。這種情況下程式的accesss彈性就會受到限制而且也會增加overhead。

10.4 Word processors

10.7 A application that maintains a database could benefit from the system support of random access.

A volume is a single accessible storage area with a single file system.

10.8 Advantage: Greater transparency. Disadvantage: The file system containing the target file might not be mounted.
使用者並不需要知道mounted point並且可以任意建立links。
但是含有link的file system可能為mounted,而含有target file的file system則否。

10.10 在遠端和在本地出錯時的failure semantics不同。例如說存取遠端的file open可以直接fail而非當機。這樣應用程式能用比較聰明的方式去應對之。但缺點是failure semantics沒有一致姓(lack of uniformity)並且application code就更複雜了。

10.11 所有更新都要及時 這代表需要更多資料傳送
UNIX consistency semantics需要所有process對file的更新都要能夠立即對其他process availible。在remote file system中這樣support之可能會有某些缺點:所有client的update都需要立刻回傳給file server而非batched後回傳(或甚至ignored,如果update的是temporary file的話),而server的update也要馬上回傳給client,造成更多communication。

留言