-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Nonblockingdb Status
Student: Nazar Gerasymchuk (email: nazar.gerasymchuk at gmail.com, IRC: tr0)
Mentor: Daniel Schürmann (email: daschuer at mixxx.org, IRC: daschuer)
You can find me there, and contact me through blogs comments:
- https://nonblockingdb.wordpress.com/ (EN) -- blog for news on my developing process at GSoC 2013.
- http://neval8.wordpress.com/ (EN, UA) -- my personal blog with tips'n'tricks, hacks and so on.
My fork of Mixxx at GitHub: https://github.com/troyane/mixxx
- Improve my Git skills
- Get involved in developing of Mixxx
- Solve different bugs on Mixxx
- Build new scheme for database access in Mixxx
- Test that scheme, try to find bottlenecks, possible deadlocks...
- Code that scheme separate from Mixxx
- Write documentation on scheme
- Apply that scheme to Mixxx
- Test Mixxx with my scheme
- PROFIT :)
In general, I see two milestones:
- Before midterm: prepare separate working prototype for db access.
- Before finalterm: merge prototype into Mixxx.
-
Week (17.06 -- 23.06)
- Write down this schedule.
- Write article "Overview of all what we have in Mixxx (Qt, SQLite, threads, …). What to do with it?": https://nonblockingdb.wordpress.com/2013/06/19/overview-of-all-what-we-have-in-mixxx-qt-sqlite-threads-what-to-do-with-it/.
- Fork Mixxx on GitHub.
-
Week (24.06 -- 30.06)
- Dig into Sqlite and define or find some suitable test cases.
- Dig into Mixxx and find all usage of db access, analyze it, write brief description of different types of DB usage in Mixxx and think on what to aware of when designing solution.
- Prepare UML class (and probably, sequence) dias for nowadays Mixxx DB accesss. // For this purposes I use Dia (http://projects.gnome.org/dia/), ArgoUML (http://argouml-stats.tigris.org/) or Umrello (http://uml.sourceforge.net/)//
- Find all related bugs.
- Week (01.07 -- 07.07)
- Begin writing documentation.
- Writing the specs for a possible solution.
- Prepare UML class (and probably, sequence) dias for new DB accesss in Mixxx.
- Create separate repo on GitHub for prototype.
- Start implementing of prototype database access class with separate test project.
- Start Open discussion to involve other developers to review prototype.
- (Try to) Fix some bugs.
- Week (08.07 -- 14.07)
- Implement prototype database access class with separate test project.
- (Try to) Fix some bugs.
- Week (15.07 -- 21.07)
- Get acquainted with "Google Test" framework.
- Write tests using "Google Test" framework.
- (Try to) Fix some bugs.
- Week (22.07 -- 28.07)
- Add and test all possible ways of database usage present in Mixxx handled by DAO.
- (Try to) Fix some bugs.
- Week (29.07 -- 04.08)
- Finish prototype that is able to handle asynchronous db access, ..., flexible and extendable.
- Important date 29.07 -- Begins midterm deadline
- Important date 20.08 -- Midterm deadline
- For midterm I'll prepare separate prototype project on separate repo.
- Week (05.08 -- 11.08)
- Plan (re-plan) schedule of work for finalterm.
- ...
- (Try to) Fix some bugs.
- Week (12.08 -- 18.08)
- ...
- (Try to) Fix some bugs.
- Week (19.08 -- 25.08)
- ...
- (Try to) Fix some bugs.
- Week (26.08 -- 01.09)
- ...
- (Try to) Fix some bugs.
- Week (02.09 -- 08.09)
- ...
- (Try to) Fix some bugs.
- Week (09.09 -- 15.09)
- Iron out remaining bugs.
- Merge my branch with master.
- Week (16.09 -- 22.09)
- Important date 16.09 -- Pencils down begins
- Week (23.09 -- 29.09) :
- Important date 27.09 -- Finalterm deadline
- 01.10 : end
Currently I'm working on:
- Extended article to collect as much as possible information about project and how to solve it: http://nonblockingdb.wordpress.com/2013/06/19/overview-of-all-what-we-have-in-mixxx-qt-sqlite-threads-what-to-do-with-it/
- My very approximate roadmap for this summer:
Roadmap:
- Learn SQLite deeper as Daniel pointed (learn sources of SQLite multi-threading).
- Fork Mixxx on GitHub
- Create empty class
DBAccessor
- add own class inherited from
QThread
, named, for example, DBAccessor - create handmade
DBAccessor
's event-loop (likewhile(1)
...) - make class
DBAccessor
Singletone and all-source-wide - make
DBAccessor
instantiate on Mixxx startup - code freeing
DBAccessor
on Mixxx exit - Code
DBAccessor
's queue manager - code placing query into queue
- code controlling on executed queries
- code removing from queue
- ...
- Code
DBAccessor
's minimal access to SQLite db -
(Think first on how to) Organize
DAO
's names, priorities, and so on so we can send it as parameter toDBAccessor
Currently some database transactions are stalling the GUI. This is because some database queries are preformed from the GUI thread.
This should be solved during the project by something like a standard non blocking interface to sqlite. All Database queries should be issued though this new interface.
This project would make Mixxx more reliable by this new concept how to deal with database actions.
Your proposal should include a draft proposal how do you will achieve the goal. You should have already have experience in parallel processing and sqlite.
Let’s use RPC-style pure callbacks. I can propose to create class
DBManager
. DBManager
will be a singleton and it will be instance in
separate thread (inherited from QThread
). This class will have own
event loop. Also it will have queue of queries and pointers to QFuture
objects to control (in own event loop) what queries have been executed.
We need one thread (DBManager
) for management database access (and if
needed -- solve probably conflicts), other (there can be more than one,
so we can use QtConcurrent::run
and pointers to QFuture
objects to
handle states and results) is for executing queries to database.
The task of processing a short queue of queries to database is a probably long time procedure, so we need to have separate thread for it. By the way we don’t miss possibility to execute multiple queries in the same time (if it is possible).
Executing queries from GUI thread is not good idea -- we’ll avoid it. After DBManager will be applied, we’ll got only one unified entry point to access database.
As this class will be singleton, it can be reachable from every module. All queries will be applied through DBManager this way:
- On module side (from concrete class):
- prepare query,
- set query parameters (such as type of needed
DAO
, priority or transaction recommendations), - prepare callback function (function to apply after successfully executing query),
- call
DBManager
’s function to apply query with own callback functions(s) as parameter(s). - On
DBManager
side: - got new query into own queue of queries,
- scan current active queries,
- solve conflicts on how to place this query into queue of queries (to avoid blocking and other moments -- must discuss it),
- create new thread using
QtConcurrent::run
and run query from queue (if possible) using respectiveDAO
-object in it and control it usingQFuture
, - check what queries executed and execute respective callbacks.
Of course, there are lot of moments to discuss on.
More information will be here soon.
Mixxx is a free and open-source DJ software.
Manual
Hardware Compatibility
Reporting Bugs
Getting Involved
Contribution Guidelines
Coding Guidelines
Using Git
Developer Guide
Creating Skins
Contributing Mappings
Mixxx Controls
MIDI Scripting
Components JS
HID Scripting