Hi Mixxx Developers,

i want to point out to the results of Nazars successful GSoC project in:
https://github.com/mixxxdj/mixxx/pull/73

Nazar has introduced a way to execute all (possible blocking) database
access functions to a dedicated thread.

Thanks to C++11 Lamdas, this was possible without huge changes to the logic
of DB access.

Most changes are following this schema:

Original code:
TrackPointer pTrack = m_pTrackCollection->getTrackDAO().getTrack(trackId);

New Code:
 TrackPointer pTrack;
m_pTrackCollection->callSync(
        [this, &trackId, &pTrack] (void) {
    pTrack = m_pTrackCollection->getTrackDAO().getTrack(trackId);
}, __PRETTY_FUNCTION__);

callSync queues the Lambda for execution and waits for the result, captured
by pTrack.
Other slots GUI slots are executed during waiting, to avoid blocking.

More details of implementation are listed here:
http://mixxx.org/wiki/doku.php/lambda_scheme

A hard part at the end of the project was to decide which function should
be called from the
GUI thread and which from the database thread. We came to the conclusion,
that all
sqlite function must be called from the database (track collection) thread
and all
Model functions must be called from the GUI thread, to avoid race
conditions.

The result is a extra smooth and responsive Mixxx version, that is worth to
become
part of 1.12.

Since Nazar's patch touches every library access function, it is most
likely that there
are remaining edges in the code. This should be ironed out before merge,
because
Bugs due to introduced race conditions are hard to debug.

So please review and/or test this merge request, that we can successful
merge finally.
Also a part review of this big patch is helpful.

If you have other question and concerns, please reply to mixxx-devel or on
github.

Thank you very much!

Kind regards,

Daniel
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&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

Reply via email to