作業系統基礎知識

來源:互聯網
上載者:User

linux系統組成部分:linux核心、shell、工具 + 生產力utility、應用程式、檔案系統。

原語:若干機器指令構成的一段代碼,原語在執行期間不可分割,一旦開始執行,不能被中斷。


PV原語:與處理序間通訊機制訊號量對應的話,當訊號量大於0時,表示可供並發進程使用的資源數,小於0時,表示等待中的進程數。P操作訊號量-1,V操作訊號量+1。PV操作每個進程只能成對使用一次。

進程調度:先進先出、時間片輪詢、最高優先順序和多級隊列反饋。

處理序間通訊方法:

訊號量(特殊地,互斥訊號量和同步訊號量為初始值為1和0的訊號量)、

共用記憶體、

訊息機制(包括訊息緩衝和信箱)、

管道通訊(也叫共用檔案通訊)。

http://en.wikipedia.org/wiki/Deadlock

進程死結的四個條件:互斥條件、請求與保持條件、不剝奪條件和迴圈等待條件。

A deadlock situation can arise if and only if all of the following conditions hold simultaneously in a system:[1]

  1. Mutual Exclusion: At least one resource must be non-shareable.[1] Only
    one process can use the resource at any given instant of time.
  2. Hold and Wait or Resource Holding: A process is currently holding at least one resource and requesting additional resources which are being held by other processes.
  3. No Preemption: The operating system must not de-allocate resources
    once they have been allocated; they must be released by the holding process voluntarily.
  4. Circular Wait: A process must be waiting for a resource which is being
    held by another process, which in turn is waiting for the first process to release the resource. In general, there is a set of
    waiting processes, P = {P1, P2, ..., PN}, such that P1 is waiting for a resource held by P2,
    P2 is waiting for a resource held by P3 and so on till PN is waiting for a resource held by P1.[1][7]

These four conditions are known as the Coffman conditions from their first description in a 1971 article by Edward
G. Coffman, Jr.[7]Unfulfillment of any
of these conditions is enough to preclude a deadlock from occurring.

------------------------------------------------------------------------------

儲存管理:可變分區管理、頁式管理、虛擬頁式管理(又叫請求頁式管理)。

可變分區管理:編程時,所用地址都是邏輯地址,當程式裝載到記憶體時,通過儲存管理得到該進程記憶體空間的物理基地址和限定長度,並將兩者儲存在該進程的進程式控制制塊PCB中。進程運行時,所有地址的訪問,均會“邏輯地址+基地址”得到程式或資料的物理地址。邏輯上相鄰的地址,物理上也相鄰。

頁式管理:記憶體等長地分為若干物理頁面(塊),程式的邏輯空間按照同樣大小劃分為等長邏輯頁面(頁)。每個進程有一張頁表,記錄邏輯頁面和物理頁面的對應關係,頁表行數等於邏輯頁面數。邏輯上相鄰的頁面,物理上不一定相鄰。頁表基址和頁表長度儲存在該進程的進程式控制制塊中。如果程式佔用儲存空間較大,則頁表佔用空間可能超過一個頁面,此時可採用多級頁表結構。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.