- Expert C++
- Vardan Grigoryan Shunguang Wu
- 262字
- 2021-06-24 16:33:57
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.
Let's begin with an introduction to the memory structure and then investigate data types within the memory.
- Embedded Linux Projects Using Yocto Project Cookbook
- Functional Python Programming
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- Rake Task Management Essentials
- 算法基礎:打開程序設計之門
- Scala Design Patterns
- Java FX應用開發教程
- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Unity 5 for Android Essentials
- 單片機應用與調試項目教程(C語言版)
- 數據結構案例教程(C/C++版)
- Python深度學習:基于TensorFlow
- Serverless computing in Azure with .NET
- JavaScript程序設計(第2版)