欧美vvv,亚洲第一成人在线,亚洲成人欧美日韩在线观看,日本猛少妇猛色XXXXX猛叫

新聞資訊

    本文使用 Zhihu On 創作并發布

    11

    File-

    操作系統作業11

    每題最后一個引用塊是老師提供的參考答案

    11.2, 11.3, 11.5, 11.10, 11.11, 11.12

    11.2 Why do some keep track of the type of a file, while leave it to the user and do not file types? Which is “?”

    為什么有些系統會記錄文件的類型,而其他系統則讓用戶自己來記錄,還有一些系統干脆不實現多文件類型?哪個系統 "更好"?

    答:

    各有優劣,區分以適應不同用途。

    Some allow file based on the type of the file (for , an ascii file can be read as a while a file can be read via an index to a block).

    船舶電氣設備及系統課后答案_操作系統概念第九版課后答案_非線性系統課后答案

    Other leave such of a file’s data to the and no help in the data.

    The that is “” on the needs of the on the , and the the users place on the .

    If a runs , it may be more for the to a -type file and , than each the same thing ( in ways).

    For - it may be to only basic file types to keep the size and allow to the on the .

    一些系統允許根據文件的類型進行不同的文件操作(例如,一個ascii文件可以作為一個流來讀,而一個數據庫文件可以通過一個索引來讀一個塊)。其他系統則把對文件數據的這種解釋留給進程,并且不提供訪問數據的幫助。哪種方法 "更好",取決于系統中進程的需求,以及用戶對操作系統的要求。如果一個系統主要運行數據庫應用程序,操作系統實現數據庫類型的文件并提供操作可能更有效,而不是讓每個程序實現同樣的東西(可能以不同的方式)。對于通用系統來說,只實現基本的文件類型可能更好,這樣可以使操作系統的規模更小,并允許系統中的進程獲得最大的自由。

    11.3 , some many types of for a file’s data, while a of bytes. What are the and of each ?

    同樣,有些系統支持許多類型的文件數據結構,而另一些系統只是支持字節流。每種方法的優勢和劣勢是什么?

    答:

    An of the file is that the comes from the ; are not to the . In , if the the for file , it can the more than an .

    The of the for file types is that it the size of the . In , that may file types other than what is by the may not be able to run on such .

    船舶電氣設備及系統課后答案_操作系統概念第九版課后答案_非線性系統課后答案

    An is for the to no for file and treat all files as a of bytes. This is the taken by UNIX . The of this is that it the for file , as the no has to the for file types. , it to file , the where a may not a file for a .

    讓系統支持不同的文件結構的一個好處是,這種支持來自于系統;不需要個別應用程序提供支持。此外操作系統概念第九版課后答案,如果系統提供對不同文件結構的支持,它可以比應用程序更有效地實現支持。讓系統為定義的文件類型提供支持的缺點是,它增加了系統的大小。此外,可能需要不同的文件類型而不是系統提供的文件類型的應用程序可能無法在這種系統上運行。另一種策略是操作系統不定義對文件結構的支持,而是將所有文件視為一系列的字節。這就是UNIX系統所采取的方法。這種方法的優點是,它簡化了操作系統對文件系統的支持,因為系統不再需要為不同的文件類型提供結構。此外,它允許應用程序定義文件結構,從而緩解了系統可能不提供特定應用程序所需的文件定義的情況。

    11.5 the of the open() and close() .

    解釋open()和close()操作的目的。

    答:

    打開一個文件,關閉一個文件

    of open( ) : The of open( ) is open an file. For this the an open-file table, it about the all open files. The open() can three task: fist take the file name, the , and copy the entry into the open-file table. The open( ) can also the modes. They are read only, write only, read/write, and so on. When the mode is , then the file is for the .

    of close ( ) : The of close() is when the its on an open file then the close() . The close() the open count, which could be with each file to how many have the file open. When open count the zero, the file is no in use, and the file entry is from the open-file table.

    open( )操作的目的。open( )操作的目的是打開一個活動文件。為此,操作系統維護一個開放文件表,它包含所有開放文件的信息。open()操作可以執行三個任務:取文件名,搜索整個目錄,最后將目錄條目復制到open-file表中。open()操作還可以驗證訪問模式。它們是只讀、只寫、讀/寫,等等。當請求模式可以接受時,那么該文件就被打開,供進程使用。

    close()操作的目的。close()操作的目的是當進程完成了對一個開放文件的操作后,執行close()操作。close()操作減少了開放計數,它可以與每個文件相關聯,以表明有多少進程打開了該文件。當打開次數達到零時,該文件就不再被使用,該文件條目就會從打開文件表中刪除。

    操作系統概念第九版課后答案_船舶電氣設備及系統課后答案_非線性系統課后答案

    11.10 The open-file table is used to about files that are open. the a table for each user or just one table that to files that are being by all users? If the same file is being by two or users, there be in the open-file table? .

    open-file表是用來維護當前打開的文件信息的。操作系統應該為每個用戶維護一個單獨的表,還是只維護一個包含所有用戶當前正在訪問的文件的表?如果同一個文件被兩個不同的程序或用戶訪問,在開放文件表中是否應該有單獨的條目?解釋一下。

    答:

    By a open-file table, the can the that would be . a file that is being by one or more . If the file is , then it not be from the disk until all the file have it. This check can be only if there is of of the file.

    On the other hand, if two are the file, then two need to be to keep track of the of which parts of the file are being by the two . This the to for the two .

    通過保留一個中央開放文件表,操作系統可以執行以下操作,否則是不可行的。考慮到一個文件目前正被一個或多個進程訪問。如果該文件被刪除,那么在所有訪問該文件的進程都關閉該文件之前,它不應該從磁盤上刪除。只有在對訪問該文件的進程數量進行集中核算時,才能進行這種檢查。另一方面,如果有兩個進程在訪問該文件,那么就需要維持兩個獨立的狀態,以跟蹤文件的哪些部分正在被兩個進程訪問的當前位置。這就要求操作系統為這兩個進程維護不同的條目。

    11.11 What are the and of locks of locks whose use is left to users’ ?

    提供強制鎖,而不是由用戶自行決定使用的建議鎖,有什么優缺點?

    答:

    is a where the need to /obey a . As long as the the /API and its , the API takes care that file work . In other words, this is not an .

    操作系統概念第九版課后答案_船舶電氣設備及系統課后答案_非線性系統課后答案

    does not need any type of . The OS the / of calls of a that to do any to a file which is by .

    In such , the locks would limit the in how files could be and might also the with files.

    咨詢式鎖定是一種合作式鎖定方案,參與的進程需要遵循/遵守鎖定協議。只要進程遵循鎖定協議/API并尊重其返回值,底層API就能保證文件鎖定語義的正常工作。換句話說操作系統概念第九版課后答案,這不是一個強制的鎖定方案。強制鎖定不需要進程之間的任何類型的合作。操作系統保證對試圖對已經被另一個進程鎖定的文件進行任何并發修改的進程的系統調用的阻塞/失敗。

    在這種情況下,強制鎖將限制對文件的訪問方式的靈活性,也可能增加與訪問文件相關的開銷。

    11.12 of that files to the :

    提供通常按照以下方法訪問文件的應用程序的例子。

    順序

    答:

    that - word , video , music and web .

    船舶電氣設備及系統課后答案_非線性系統課后答案_操作系統概念第九版課后答案

    連續訪問文件的應用程序--文字處理器、視頻播放器、音樂播放器和網絡管理。

    隨機

    答:

    that - , video and sound .

    任意訪問文件的應用程序 - 數據庫、視頻和聲音編輯器。

    None

    注:

    翻譯:deepl

    參考資料:

    [1] – 9th 及其答案

網站首頁   |    關于我們   |    公司新聞   |    產品方案   |    用戶案例   |    售后服務   |    合作伙伴   |    人才招聘   |   

友情鏈接: 餐飲加盟

地址:北京市海淀區    電話:010-     郵箱:@126.com

備案號:冀ICP備2024067069號-3 北京科技有限公司版權所有