• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

RegistryKey.SetValue atomic or not.

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    RegistryKey.SetValue atomic or not.

    I've been trying to discover if this is atomic or not. I need some certainty for durability over a power fail.

    So, if I set a value in the registry with this, and the method returns, is it guaranteed that it is flushed (i.e. I will retrieve this value on a restart after a power fail?)

    Still searching the 10 zillion hits I get.

    #2
    Dunno if this helps you out any: RegistryKey.Flush Method (Microsoft.Win32)
    McCoy: "Medical men are trained in logic."
    Spock: "Trained? Judging from you, I would have guessed it was trial and error."

    Comment


      #3
      Originally posted by lilelvis2000 View Post
      Dunno if this helps you out any: RegistryKey.Flush Method (Microsoft.Win32)
      Looks like that#ll do the trick. Doesn't return until written (mind you I guess there is a risk that the disk hardware could conspire againstme. )

      Comment


        #4
        Originally posted by ASB View Post
        Looks like that#ll do the trick. Doesn't return until written (mind you I guess there is a risk that the disk hardware could conspire againstme. )
        Well, you can only do so much from a software perspective - if it's server based, you'd hope they were using a battery backed write cache.

        I'm no programmer, but does your data have to be registry based? If it were XML, you may be able to take a little more control over what happens to the data, but I guess it all depends on how abstracted you are and what the hardware is. If it's a SAN backed virtual environment you have no chance of guaranteeing a write!

        Comment

        Working...
        X