📄 region.so
字号:
m4_comment([$Id: region.so,v 10.33 2005/06/11 12:32:49 bostic Exp $])m4_ref_title(Environment, Shared memory regions,, env/naming, env/security)m4_p([dnlEach of the m4_db subsystems within an environment is described by oneor more regions, or chunks of memory. The regions contain all of theper-process and per-thread shared information (including mutexes), thatcomprise a m4_db environment. These regions are created in one of threetypes of memory, depending on the flags specified to them4_refT(dbenv_open):])m4_nlistbeginm4_nlist([dnlIf the m4_ref(DB_PRIVATE) flag is specified to the m4_refT(dbenv_open),regions are created in per-process heap memory; that is, memory returnedby m4_manref(malloc, 3).m4_p([dnlThis flag should not be specified if more than a single process isaccessing the environment because it is likely to cause databasecorruption and unpredictable behavior. For example, if both a serverapplication and m4_db utilities (for example, m4_ref(db_archive),m4_ref(db_checkpoint) or m4_ref(db_stat)) are expected to access theenvironment, the m4_ref(DB_PRIVATE) flag should not be specified.])])m4_nlist([dnlIf the m4_ref(DB_SYSTEM_MEM) flag is specified to m4_ref(dbenv_open),shared regions are created in system memory rather than files. This isan alternative mechanism for sharing the m4_db environment amongmultiple processes and multiple threads within processes.])m4_p([dnlThe system memory used by m4_db is potentially useful past the lifetimeof any particular process. Therefore, additional cleanup may benecessary after an application fails because there may be no way form4_db to ensure that system resources backing the shared memory regionsare returned to the system.])m4_p([dnlThe system memory that is used is architecture-dependent. For example,on systems supporting X/Open-style shared memory interfaces, such asUNIX systems, the m4_manref(shmget, 2) and related System V IPCinterfaces are used. Additionally, VxWorks systems use system memory.In these cases, an initial segment ID must be specified by theapplication to ensure that applications do not overwrite each other'sdatabase environments, so that the number of segments created does notgrow without bounds. See the m4_refT(dbenv_set_shm_key) for moreinformation.])m4_p([dnlOn Windows platforms, the use of the m4_ref(DB_SYSTEM_MEM) flag isproblematic because the operating system uses reference counting toclean up shared objects in the paging file automatically. In addition,the default access permissions for shared objects are different fromfiles, which may cause problems when an environment is accessed bymultiple processes running as different users. Seem4_link(M4RELDIR/ref/build_win/notes, [Windows Notes]) for moreinformation.])m4_nlist([dnlIf no memory-related flags are specified to m4_ref(dbenv_open), memorybacked by the filesystem is used to store the regions. On UNIX systems,the m4_db library will use the POSIX mmap interface. If mmap is not available,the UNIX shmget interfaces may be used instead, if they are available.])m4_nlistendm4_idefz(__db.001)m4_p([dnlAny files created in the filesystem to back the regions are created inthe environment home directory specified to the m4_ref(dbenv_open) call.These files are named [__db.###] (for example, __db.001, __db.002 andso on). When region files are backed by the filesystem, one file perregion is created. When region files are backed by system memory, asingle file will still be created because there must be a well-knownname in the filesystem so that multiple processes can locate the systemshared memory that is being used by the environment.])m4_p([dnlStatistics about the shared memory regions in the environment can bedisplayed using the m4_option(e) option to the m4_ref(db_stat) utility.])m4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -