Session Semantics

Session semantics 以 open()close() 的 file session 為 visibility boundary:session 內的 writes 不必立刻對其他已 open sessions 可見;close 後,修改才保證對之後新開始的 sessions 可見。

Andrew File System(AFS / OpenAFS)是代表例。

Intuition

同一 file 可暫時有多個 images。Client / session 可在 cached copy 上操作,close 時再提交結果。這和 D-OS-Ch15ga-UNIX_Semantics 的 single shared image 相反:它接受 temporary divergence 來換取 caching efficiency。

適用與限制

適合「打開、編輯、關閉;別人之後再打開看到新版」的 workload。不適合即時協作、database、log file、強一致性需求。若 A / B 同時編輯並 close,系統還要定義 last-writer-wins、conflict file、merge policy,或交給 application 處理。

Session semantics 犧牲 immediate visibility,換取 fewer network round trips 與 better distributed caching。