Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows NT / Registry / September 2008

Tip: Looking for answers? Try searching our database.

Windows Server 2003 - registry concurrency model

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Олег Руденко - 15 Sep 2008 23:09 GMT
Hi,

Does anybody know how Windows Server 2003 handles simultaneous attempts to
access registry data? If it protects the data from being changed by
different threads at the same time (I'm sure it does), what is a granularity
of this protection? Is it hive-, key-, or value-wide? Do multiple readers
block each other, or only reader-writer, writer-writer do?

Thanks,
 Oleg Roudenko
John John (MVP) - 17 Sep 2008 14:00 GMT
Atomicity, Data Flushing and Transaction Logs.

John

> Hi,
>
[quoted text clipped - 6 lines]
> Thanks,
>  Oleg Roudenko
Олег Руденко - 18 Sep 2008 20:51 GMT
Cool. But what is level of this atomicity? Is it value of individual
parameter, key, hive, entire registry?
Again, what is the smallest part of registry to which transaction is
applied?

Oleg

> Atomicity, Data Flushing and Transaction Logs.
>
[quoted text clipped - 11 lines]
>> Thanks,
>>  Oleg Roudenko
John John (MVP) - 18 Sep 2008 22:41 GMT
It applies down to individual values.  The following exerpt may provide
answers to your questions:

[Quote]

Atomicity and Hive Recovery in the Registry

The Registry ensures atomicity of individual actions. This means that
any change made to a value (to set, delete, or save) either works or
does not work: The result will not be a corrupted combination of the old
and new configuration even if the system stops unexpectedly because of
power failure, hardware failure, or software problems. For example, if
an application sets a value for an entry and the system shuts down while
this change is being made, when the system restarts, the entry will have
either the old value or the new value, but not a meaningless combination
of both values. In addition, the size and time data for the key
containing the affected entry will be accurate whether the value was
changed or not changed.

Flushing Data

In Windows NT, data is written to the Registry only when a flush occurs,
which happens after changed data ages past a few seconds, or when an
application intentionally flushes the data to the hard disk.

The system performs the following flush process for all hives (except
for the System hive):

1. All changed data is written to the hive's .log file along with a map
of where it is in the hive, and then a flush is performed on the .log
file. All changed data has now been written in the .log file.

2. The first sector of the hive file is marked to indicate that the file
is in transition.

3. The changed data is written to the hive file.

4. The hive file is marked as completed.

Note If the system shuts down between steps 2 and 4, when the hive is
next loaded at startup (unless it's a profile hive that is loaded at
logon), the system sees the mark left in step 2, and proceeds to recover
the hive using the changes contained in the .log file. That is, the .log
files are not used if the hive is not in transition. If the hive is in
transition, it cannot be loaded without the .log file.

A different flush process is used for the System hive because it is an
important element during system startup and is used too early during
startup to be recovered as described in the previous flush process.

The System.alt file contains a copy of the data contained in the System
file. During the flush process, changes are marked, written, and then
marked as done. Then the same flush process is followed for the
System.alt file. If there is a power failure, hardware failure, or
software problems at any point during the process, either the System or
System.alt file contains the correct information.

The System.alt file is similar to a .log file except that at load time,
rather than having to reapply the logged changes, the system just
switches to System.alt. The System.alt file is not needed unless the
System hive is in transition.

[end quote]

http://www.microsoft.com/resources/documentation/windowsnt/4/workstation/reskit/
en-us/23_regov.mspx


John.

> Cool. But what is level of this atomicity? Is it value of individual
> parameter, key, hive, entire registry?
[quoted text clipped - 18 lines]
>>> Thanks,
>>>  Oleg Roudenko
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.