initial support for parallel rendering via worker-threads - far from being perfect (especially with small mixer-period-sizes) but seems to help even on a DualCore machine

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@720 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-02-27 00:45:30 +00:00
parent b5c9a36785
commit e0851b970e
2 changed files with 154 additions and 34 deletions

View File

@@ -31,6 +31,7 @@
#endif
#include <QtCore/QMutex>
#include <QtCore/QSemaphore>
#include <QtCore/QThread>
#include <QtCore/QVector>
@@ -91,6 +92,8 @@ const tones BASE_TONE = A;
const octaves BASE_OCTAVE = OCTAVE_4;
class mixerWorkerThread;
class mixer : public QObject
{
@@ -361,7 +364,10 @@ private:
bool m_newBuffer[SURROUND_CHANNELS];
Uint8 m_cpuLoad;
int m_parallelizingLevel;
bool m_multiThreaded;
QVector<mixerWorkerThread *> m_workers;
QSemaphore m_workerSem;
playHandleVector m_playHandles;
constPlayHandleVector m_playHandlesToRemove;
@@ -389,6 +395,7 @@ private:
friend class engine;
friend class mixerWorkerThread;
} ;