View Single Post
  #37  
Old 01.10.2011, 11:32
weaverslodge
Guest
 
Posts: n/a
Default

Not sure I've posted here before but was checking out reasons for my files not being saved correctly and I came across this thread.

Firstly, a comment

Atomic - This has been overused and badly used. The renaming of a file that is within the same filesystem is an atomic operation due to the fact that the function is just to update the filesystem header with the new information. This will be handled by the FS code in the operating system. It'll be the same for Windoze aswell as Unix (Mac). If you are crossing filesystems then the rename is not a rename, it is a copy and then delete (or unlink system call if you're picky :-)) which is definitely not atomic. Th original idea of an atomic operation is an operation that cannot be stopped in the sense that it happens during one clock cycle and cannot be interrupted. Not quite sure how the advent of dual or quad core chips impacts on atomic operations, but I think that the concept is the same.

One thing that I cannot understand that one of the devs said was that if they know something bad has happened and they can't restart the download then they allow the part file to be removed. This is bizarre !!! You must know at that point that the file has completed the download as the code for the rename wouldn't even be accessed until that had happenned. So if you do get an error from the rename then there is no reason to remove the file. It was said that it was JD that was removing the part file. Why would JD even get involved in removing the part file? If the rename works then there is no part fle to remove anyway. If it didn't work then the error is there and the user can investigate for themselves.

If I were to hazard a guess I would think that you had an error function that you dropped into that cleaned up in the event of an error and that this error shouldn't fall into that category but has unfortunately done so.

Cheers

Dave
Reply With Quote