[Rhythmbox-devel] Syncing the RhythmDB on every update

I want to get that sorted out.  The database really should be saved to
disk on every change immediately (including rating changes).

Not aware of all the possible pitfalls, I just implemented a naive
scheme where a rhythmdb_save() is performed on every
rhythmdb_write_unlock().  Yes, I hooked it to the rw lock, to catch all
changes.  I also added rhythmdb_inhibit_syncs() and
rhythmdb_permit_syncs() to prevent saving on every step of a long chain
of write accesses.

I inserted a sync inhibit in rhythmdb_load_thread_main() to fix startup
performance (and, well, to not lose half the DB when startup is
ctrl-c'ed, pitfall #1).  That didn't work so well in the
add_thread_main() (maybe it deadlocked that thread, didn't look too

That work can be found as aeb@debian.org--2004/rhythmbox--syncdb--0.7.
I'm interested in comments about the things that are horribly wrong
about it.

Andreas Bombe <bombe@informatik.tu-muenchen.de>    GPG key 0x04880A44

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]