Merge lp://qastaging/~mixxxdevelopers/mixxx/atomic-co into lp://qastaging/~mixxxdevelopers/mixxx/trunk
Status: | Merged |
---|---|
Merged at revision: | 3373 |
Proposed branch: | lp://qastaging/~mixxxdevelopers/mixxx/atomic-co |
Merge into: | lp://qastaging/~mixxxdevelopers/mixxx/trunk |
Diff against target: |
5303 lines (+2417/-1518) 63 files modified
mixxx/build/depends.py (+2/-3) mixxx/res/controllers/Hercules DJ Console RMX 2.midi.xml (+963/-0) mixxx/res/controllers/Hercules-DJ-Console-RMX-2-scripts.js (+128/-0) mixxx/src/control/control.cpp (+132/-0) mixxx/src/control/control.h (+95/-0) mixxx/src/control/controlbehavior.cpp (+194/-0) mixxx/src/control/controlbehavior.h (+97/-0) mixxx/src/control/controlvalue.h (+157/-0) mixxx/src/controlbeat.cpp (+0/-85) mixxx/src/controlbeat.h (+0/-59) mixxx/src/controllers/controller.h (+0/-2) mixxx/src/controllers/controllerengine.cpp (+6/-11) mixxx/src/controllers/controllermanager.cpp (+0/-4) mixxx/src/controllers/controllermanager.h (+0/-1) mixxx/src/controllers/midi/midicontroller.cpp (+5/-16) mixxx/src/controllers/midi/midioutputhandler.cpp (+11/-20) mixxx/src/controllers/midi/midioutputhandler.h (+2/-2) mixxx/src/controllers/softtakeover.cpp (+1/-1) mixxx/src/controllinpotmeter.cpp (+5/-24) mixxx/src/controllinpotmeter.h (+1/-10) mixxx/src/controllogpotmeter.cpp (+11/-87) mixxx/src/controllogpotmeter.h (+3/-21) mixxx/src/controlnull.cpp (+0/-27) mixxx/src/controlnull.h (+0/-34) mixxx/src/controlobject.cpp (+73/-317) mixxx/src/controlobject.h (+49/-117) mixxx/src/controlobjectthread.cpp (+40/-69) mixxx/src/controlobjectthread.h (+33/-35) mixxx/src/controlobjectthreadmain.cpp (+14/-14) mixxx/src/controlobjectthreadmain.h (+9/-24) mixxx/src/controlobjectthreadwidget.cpp (+33/-46) mixxx/src/controlobjectthreadwidget.h (+7/-10) mixxx/src/controlpotmeter.cpp (+68/-135) mixxx/src/controlpotmeter.h (+10/-12) mixxx/src/controlpushbutton.cpp (+22/-50) mixxx/src/controlpushbutton.h (+1/-7) mixxx/src/controlttrotary.cpp (+9/-27) mixxx/src/controlttrotary.h (+2/-12) mixxx/src/dlgprefeq.cpp (+4/-2) mixxx/src/dlgprefeq.h (+1/-1) mixxx/src/dlgtrackinfo.h (+9/-1) mixxx/src/engine/bpmcontrol.cpp (+1/-1) mixxx/src/engine/enginemaster.cpp (+0/-6) mixxx/src/engine/enginemaster.h (+0/-1) mixxx/src/engine/loopingcontrol.cpp (+41/-22) mixxx/src/engine/ratecontrol.cpp (+10/-5) mixxx/src/engine/syncworker.cpp (+0/-37) mixxx/src/engine/syncworker.h (+0/-23) mixxx/src/mixxx.cpp (+0/-7) mixxx/src/mixxx.h (+0/-1) mixxx/src/mixxxkeyboard.cpp (+2/-2) mixxx/src/playermanager.cpp (+73/-44) mixxx/src/playermanager.h (+17/-3) mixxx/src/skin/legacyskinparser.cpp (+0/-10) mixxx/src/skin/propertybinder.cpp (+1/-2) mixxx/src/sounddeviceportaudio.cpp (+3/-2) mixxx/src/soundmanager.cpp (+0/-6) mixxx/src/soundmanager.h (+0/-2) mixxx/src/vinylcontrol/vinylcontrolmanager.cpp (+10/-10) mixxx/src/waveform/renderers/waveformmarkset.cpp (+2/-2) mixxx/src/waveform/renderers/waveformrendererendoftrack.cpp (+1/-1) mixxx/src/widget/wpushbutton.cpp (+2/-1) mixxx/src/widget/wslidercomposed.cpp (+57/-44) |
To merge this branch: | bzr merge lp://qastaging/~mixxxdevelopers/mixxx/atomic-co |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Schürmann | Needs Fixing | ||
RJ Skerry-Ryan | Needs Fixing | ||
Review via email:
|
Description of the change
This is the first transition of the control object part of Mixxx for a proof of concept as described in http://
The core change was made in http://
The class ControlObjectValue provides a lock-free thread save access to the value of the control object. Relying on this, it was possible to remove the mirrored values in the control object proxies and all the ugly code for syncing it. The new concept should provide an instant access to the control object values without possible delays of sync tasks or overloaded queues.
I have tried to keep the interface of the control objects untouched. Defining a suitable interface, and allowing different value types will be issued in the next transition, when this one is approved.
When reviewing please, give a particularly critical look to ControlObjectValue for verify that it provides such an atomic access.
Sorry for taking so long to get you feedback :( better late than never?
I've skimmed the whole thing once but for now will just comment on controlobjectba se.h:
* static const int cReaderSlotCnt
- Should not be static.. if multiple object files include controlobjectbase.h then we will get duplicate symbols during linking. This builds fine now because only controlobject.o includes it. You could just leave it as a const int.
* sizeof(T) <= sizeof(void*) is not enough to determine atomicity -- for example, if the pointer to a value is not memory-aligned then that breaks atomicity guarantees. I think to be sure we need to use a compiler directive in the ATOMIC=true template to request m_value is aligned.
* Need comments on all methods declarations in controlobjectba se.h. This is such a crucial file it needs plenty of documentation for future developers :).
* ControlObjectRi ngValue: :tryGet( ) fetchAndAddAcqu ire(-1) ; fetchAndAddAcqu ire(-1) <= 0;
- why return an int when it's functionally a bool (i.e. was it successful)
- bool originalSlots = m_readerSlots.
Should instead be:
bool originalSlots = m_readerSlots.
The reason is this: m_readerSlots can go negative if too many concurrent reads occur simultaneously. It can even go negative if a write is happening and two reads happen right after the write has swapped m_readerSlots with the value 0 (the second read will see -1). So to detect whether a read should be successful, you should check if the value is <= 0.
- Why is cReaderSlotCnt the number of concurrent readers allowed also the size of the ring buffer? I can't think of a reason why those 2 values need to be the same.
- How did you choose 7?
* ControlObjectVa lue::getValue
- Can you use ARRAYSIZE on m_ring instead of hard-coding cReaderSlotCnt+1 ? It should be compile-time.
- When getValue() fails to read a slot, it goes backward one. This means we sacrifice consistency for speed. We need to make sure people understand this is a trade-off that is part of the control system. Under high load, the control system will possibly serve a stale result when you get().