Hi Nazar sorry for the late answer.
Dividing the library scanning into smaller chunks sounds like a good idea. Did you check what others (Amarok,Clementine,Exaile,Banshee,...) do to handle a complete library rescan? I also have some questions about the implementation. What is your DBAccessor? Will this thing life in a separate thread? Will this be the only class that mixxx later uses for database access and by that be replacing direct access to the DAO's that we have all over mixxx? Also how far are you writing test functions for the DAO's? I might want to copy from them :-) best Max On Fri, Jul 12, 2013 at 03:41:05PM -0700, troyane wrote: > As you may know, my name is Nazar Gerasymchuk and I’m working on refactoring > of library concurrency. All of my work is related with access to database > and I’m trying to optimize it. You can see Blueprint connected to this theme > on Launchpad <https://blueprints.launchpad.net/mixxx/+spec/nonblockingdb> . > Here you can find information on my project wiki-page > <http://www.mixxx.org/wiki/doku.php/nonblockingdb_status> . > > I want to consult with others about my further work. > > We got one long-time operation -- library scanning. I’ll try to implement > this scheme instead of one big transaction: > > - emit (start()); > - Inform user about long-time operation. > - Block UI-control element (to avoid querying equivalent queries). > - Get id for this big operation from DBAccessor > - Cycle > - - Prepare chunk of data DATA (do some FS-access/calculations/...) > - - Mark DATA by id. > - - Wrap DATA into one transaction. > - - Async send chunk of data to DBAccessor. > - Wait until DBAccessor say that big operation with id ended. > - Unblock UI-control element. > - emit (end()); > > This can give us possibility to divide all work into several pieces, do some > work, collect data in transactions and then one by one send it to DB. (But > not lock DB while doing one big transaction). Reading seems to work during > active transaction. > > Next I’ll work on is preparing test-cases: > - For SQLite (see https://github.com/troyane/SQLiteTesting) > - Create library of files for library scanner ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Get Mixxx, the #1 Free MP3 DJ Mixing software Today http://mixxx.org Mixxx-devel mailing list Mixxx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mixxx-devel