您好,登錄后才能下訂單哦!
What is the difference between pages and blocks? A block is the smallest unit of data that an operating system can either write to a file or read from a file.
What exactly is a page? Pages are used by some operating systems instead of blocks. A page is basically a virtual block. And, pages have a fixed size – 4K and 2K are the most commonly used sizes. So, the two key points to remember about pages is that they are virtual blocks and they have fixed sizes.
Why pages may be used instead of blocks Pages are used because they make processing easier when there are many storage devices, because each device may support a different block size. With pages the operating system can deal with just a fixed size page, rather than try to figure out how to deal with blocks that are all different sizes. So, pages act as sort of a middleman between operating systems and hardware drivers, which translate the pages to the appropriate blocks. But, both pages and blocks are used as a unit of data storage.
http://www.programmerinterview.com/index.php/database-sql/page-versus-block/
總結起來,也就是說,像磁盤這樣的設備之所以被稱為是塊設備,是因為其傳輸數據的基本單元是Block,即使你的目標數據只是文件中的一個字符,操作系統和驅動仍然會讀取整個塊,將你想要的目標數據給你,塊中剩余的數據則保存在一個特定的buffer/cache中。
而塊的大小在不同的操作系統上不一定是一樣的。
數據在磁盤和內存之間的傳輸是以塊的形式而不是用戶需要的特定字節,存儲在內存中的數據則是以頁的形式來進行管理,當然,匯編指令只知道字節地址~
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。