freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

操作系統(tǒng)內存管理(參考版)

2025-01-23 06:19本頁面
  

【正文】 ? 分頁和分段的主要區(qū)別是什么? 。 sharing at segment level ? 動態(tài)增長 ? 動態(tài)鏈接 4 3 0 6 2P h y s i c a l m e m o r y6 8 3 4 87 2 7 7 39 0 0 0 39 8 8 5 3S e g m e n t t a b l eP r o c e s s P 101L i m i t B a s e2 5 2 8 6 4 3 0 6 24 4 2 5 6 8 3 4 8S e g m e n t t a b l eP r o c e s s P 101L i m i t B a s e2 5 2 8 6 4 3 0 6 28 8 5 0 9 0 0 0 3S e g m e n t 1L o g i c a l a d d r e s s s p a c eP r o c e s s P 1S e g m e n t 0E d i t o rD a t a 1S e g m e n t 1L o g i c a l a d d r e s s s p a c eP r o c e s s P 2S e g m e n t 0E d i t o rD a t a 2E d i t o rD a t a 1D a t a 2段的共享 關于代碼的重入 ? 可重入代碼,又稱為“純代碼”,是一種允許多個進程同時訪問的代碼。 ? 每個段表項包括 – 段在內存中的基地址 – 段的長度 ? Segmenttable base register (STBR) – Points to the segment table’s location in memory. ? Segmenttable length register (STLR) – Indicates number of segments used by a program。 frame is aligned at 2n, so … ? Memory protection implemented by associating protection bit with each frame – Provide read only, readwrite, executeonly protection or… – Validinvalid ? “valid”: the associated page is in the process’ logical address space, and is thus a legal page. ? “invalid”: the page is not in the process’ logical address space. Valid/invalid bit example ? Address space 214 ? Page size 2KB ? Process size (0~10468) ? Page 5 has internal fragmentation ? PTLR=6 ? Page 6 amp。 memory cycle time = t time unit。 is in associative register, get frame out. – Otherwise get frame from page table in memory 聯(lián)想存儲器,快表 ? TLB miss( TLB缺失) – If the page number is not in the associative registers ? Get amp。180。 a value – Parallel search (high speed) – Expensive, typically 8~2048 entries ? Address translation (A180。 ? PageTable Base Register (PTBR) – Points to the page table currently used ? Pagetable length register (PRLR) – Indicates size of the page table ? Context switch 頁表寄存器頁表始址 頁表長度 > 頁號 ( 3 ) 頁 內地址+邏輯地址L越界中斷1塊號b頁表頁號012物理地址3+ 3 b ? Effective memoryaccess time, time needed for every data/instruction access – 需要 2次訪存 – Access the page table amp。 out cost too much – Assume: process size 1MB, disk transfer rate 5MB/sec, average latency 8ms ? Transfer time =1MB / (5MB/sec) = 1/5 sec = 200 ms ? Swap time = 208 ms ? Swap out amp。在分別使用首次適應,最佳適應,最差適應以及循環(huán)首次適應算法,對下列 3個連續(xù)空間分配,得到的空閑分區(qū)分別是什么? – 12KB – 10KB – 9KB 分區(qū)分配操作 ? 分配 – 設請求的分區(qū)大小為 ; – 利用某種分配算法,找到待分配的分區(qū),大小為 – 根據(jù)上述分區(qū)分配算法,有 – 判斷 min_size的大小 min_size為事先約定的最小分區(qū)大小 ? ,分割,分割出來的分配出去,余下的加入空閑數(shù)據(jù)結構 ? 否則,直接分配 – 將分配到的分區(qū)的首地址返回 可以看出,動態(tài)分區(qū)分配方式中內部碎片最大不超過min_size ? 回收,要考慮合并 – 向前合并 ? 只需修改前一個空閑分區(qū)表項中的大小 – 向后合并(圖) ? 只需修改后一個空閑分區(qū)表項中的起始地址和大小 – 與前后同時合并 ? 修改前一個空閑分區(qū)表項中的大小,并取消后一個分區(qū)表項 – 無相鄰空閑分區(qū),無需合并 ? 建立一個新的表項,填寫相關信息,插入 – 上述過程中,根據(jù)鏈表的維護規(guī)則,可能需要調整相應表項在空閑鏈表中的位置 動態(tài)分區(qū)分配分析 ? 隨著分配的進行,空閑分區(qū)可能分散在內存的各處 – 盡管有回收,但內存仍然被劃分的越來越碎,形成大量的外部碎片 OS process 5 process 8 process 2 OS process 5 process 2 OS process 5 process 2 OS process 5 process 9 process 2 process 9 process 10 解決方案之一:緊湊 Compaction ? 針對外部碎片:采用緊湊的方法 ? 緊湊:通過移動進程在內存中的位置,把多個分散的小分區(qū)拼成大分區(qū) ? 需要動態(tài)重定位技術支持 ? 動態(tài)重定位分區(qū)分配算法: 引入緊湊和動態(tài)重定位技術的動態(tài)分區(qū)分配算法 ? 基本與動態(tài)分區(qū)分配算法相同 思考 ? 緊湊的時間開銷:若計算機讀一個 32位的時間是 10ns,那么緊湊 128MB的空間需要多長時間? Swapping 對換 ? 最早用于 MIT的 CTSS中 – 單用戶+時間片+對換 ? 對換是指 把內存中暫時不能運行的進程,或暫時不用的程序和數(shù)據(jù),換出到外存上,以騰出足夠的內存空間,把已具備運行條件的進程,或進程所需要的程序和數(shù)據(jù),換入內存 ? 能提高內存利用率 ? 對換的單位: – 進程:整體對換;進程對換 – 頁、段:部分對換 ? 對換技術需要實現(xiàn)三個方面的功能 – 對換空間的管理 – 進程的換出 – 進程的換入 Backing store,對換空間 ? Fast disk, large enou
點擊復制文檔內容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1