抄自MS的帮助文档,写在这里方便查询

The RegistryFlags value determines how registry changes are committed to persistent storage. The hive-based registry uses memory-mapped files to store registry data; when you add the RegistryFlags value that disables background flushing, it simply disables the background flushing normally performed by the kernel. Note that the RegistryFlags value applies only to the hive-based registry, and has no effect on object store registry.

The RegistryFlags value is read only once during boot time, and is not read again until a reboot. Therefore, you cannot toggle flushing functionality. To avoid adversely affecting the boot speed, the semantics do not start until all processes in the initialization sequence have started. This assumes that registry settings written during boot time are likely to apply only to the current device state, and therefore would not require the same level of permanence that most registry settings need.

The following table shows the defined values for the RegistryFlags value:

Dword value

Description

none or 0

Default setting. Flushes the registry nondeterministically.

1

Enables aggressive flushing

2

Disables background flushing