6.4 Data in Memory


6.4 Data in Memory

Hard disk storage and other kinds of storage media are designed to store information in a persistent manner so that even when the computer is switched off, the data will remain on the storage device and can be accessed again when the computer is switched back on. Documents, spreadsheets, and photos are all examples of this kind of data. Often, people store them on persistent storage for safekeeping.

When a user runs a program, however, though the instruction set-the program itself-may be stored on persistent storage, such as a hard disk, the program will not be executed in this memory. For example, the files and data of a word processor application will be installed to a specific folder location on the computer's hard disk storage, but as the program is executed, or is running, the instructions and operations that occur are transferred to system memory, which the computer can access faster and more efficiently. So, when software creates and uses information during the course of its execution, this information is created in system memory and will not be committed to a storage disk unless it is saved.

Note 

I use the term "system memory" throughout this book, but in the world of games other kinds of memory can be used instead. System memory is volatile, meaning if the computer were switched off or if there were a power outage, the data would be lost.

Thus, when programmers write a program, they do so with some knowledge that generally it will be executed in system memory. As the program ends, the contents of this memory will be destroyed by the operating system and become vacant to be recycled for use in either another program still being executed or one that is yet to be executed.




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net