View Single Post
Old 08-03-2011, 04:04 PM   #127
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,228
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
As theducks has touched on, what people (certainly non-developers at least) don't seem to realise is that for the same reasons you cannot have two Calibre instances pointing at the database, you cannot have two threads or processes updating the database at the same time. Calibre does not have any kind of pessimistic locking mechanism. The only way to "safely" update the database is to do so back on the main UI thread. Since you could be doing any sort of other operation in Calibre at the time the only way to guarantee that the database and caches are updated without any conflicts or corruption is to do so in a synchronous fashion in a way the user is guaranteed to not be doing anything else with the database at the same time - by sticking a dialog up that once you click on prevents you from doing anything else until it is done.

It pretty much nothing to do with giving you the opportunity to "cancel" an update or viewing logs in this particular plugin.

If and when Kovid ever comes up with another mechanism for queuing database updates then we can look to change this.
kiwidude is offline   Reply With Quote