官术网_书友最值得收藏!

Working with data

When we refer to computer memory, we consider the Random Access Memory (RAM) by default, and also the RAM is a general term for either SRAM or DRAM; we will mean DRAM by default unless otherwise stated. To clear things out, let's take a look at the following diagram, which illustrates the memory hierarchy:

When we compile a program, the compiler stores the final executable file in the hard drive. To run the executable file, its instructions are loaded into the RAM and are then executed by the CPU one by one. This leads us to the conclusion that any instruction required to be executed should be in the RAM. This is partially true. The environment that is responsible for running and monitoring programs plays the main role.

Programs we write are executed in the hosted environment, which is in the OS. The OS loads the contents of the program (its instructions and data, that is, the process) not directly into the RAM, but the virtual memory, a mechanism that makes it possible both to handle processes conveniently and to share resources between processes. Whenever we refer to the memory that a process is loaded to, we mean the virtual memory, which in turn maps its contents to the RAM.

Most of the time, we use the terms RAM, DRAM, virtual memory, and memory interchangeably, considering virtual memory as an abstraction around the physical memory (the DRAM). 

Let's begin with an introduction to the memory structure and then investigate data types within the memory.

主站蜘蛛池模板: 彭阳县| 延吉市| 林周县| 江安县| 杨浦区| 策勒县| 安溪县| 米易县| 武山县| 石林| 穆棱市| 石首市| 麻江县| 彩票| 泸溪县| 蒙山县| 达日县| 竹北市| 琼中| 揭阳市| 布拖县| 金川县| 昭平县| 盐城市| 怀仁县| 克拉玛依市| 晋城| 祥云县| 灌阳县| 收藏| 汝阳县| 台东市| 隆回县| 武义县| 云霄县| 江达县| 铅山县| 宜宾县| 阿鲁科尔沁旗| 治多县| 东丽区|