|
GEOS SDK TechDocs
|
|
2.1 The VM Manager
|
2.3 Virtual Memory Blocks
There are several different types of handles associated with VM files. It is important not to get them confused.
-
File Handles
When you open or create a VM file, it is assigned a file handle, as discussed in the File System chapter. Whenever you call a VM routine, you must specify the VM file by passing this handle. The file handle can change each time the file is opened. Furthermore, if two different network users have the same VM file open at the same time, each user might have a different file handle for the same file. -
VM Block Handles
The VM file has a block table in the VM Header. The block table contains the locations of blocks in the file. A given block has the same block handle every time the file is opened. If a file is duplicated, blocks in the new file will have the same VM handles as the corresponding blocks in the old file. In this chapter, references to "block handles" or "VM handles" are referring to VM block handles unless otherwise noted.
-
Memory Block Handles
When a VM block is locked, it is copied into a memory block. This memory block has an entry in the global handle table. The memory block may persist even after the VM block has been unlocked. Ordinarily, you can refer to a VM block by its VM block handle whether or not it is resident in memory; however, in some cases, you may want to use the memory block handle instead of the VM block handle. This saves time when you know the block is resident in memory, because the VM manager doesn't have to translate the VM block handle into the corresponding global handle. It is also necessary if you need to resize or dirty a VM block. You can instruct the VM manager to use the same global handle each time a given VM block is locked until the file is closed; otherwise, the memory handle for a VM block may change each time the block is locked.
-
Chunk Handles and Database/Cell Handles
A VM block can contain a local memory heap. If so, that block will have its own chunk handle table. Also, the Database and Cell libraries have been designed to let the VM file efficiently manipulate small pieces of data. These libraries are based on the LMem library. Each item of data has its own DB handle as well as a VM Block handle. Database items are discussed in depth in the Database chapter.
|
GEOS SDK TechDocs
|
|
2.1 The VM Manager
|
2.3 Virtual Memory Blocks