2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ParallelJobs.h: Added.
(WTF::ParallelJobs::ParallelJobs):
(WTF::ParallelJobs::numberOfJobs):
(WTF::ParallelJobs::parameterForJob):
(WTF::ParallelJobs::executeJobs):
* wtf/ParallelJobsGeneric.cpp: Added.
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::executeJob):
(WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
(WTF::ParallelEnvironment::ThreadPrivate::ThreadPrivate):
(WTF::ParallelEnvironment::ThreadPrivate::create):
* wtf/ParallelJobsLibdispatch.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/ParallelJobsOpenMP.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/Platform.h:
* wtf/wtf.pri:
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* ForwardingHeaders/wtf/ParallelJobs.h: Added.
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::PaintingData::PaintingData):
(WebCore::FETurbulence::noise2D):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::fillRegion):
(WebCore::FETurbulence::fillRegionWorker):
(WebCore::FETurbulence::apply):
* platform/graphics/filters/FETurbulence.h:
Canonical link: https://commits.webkit.org/74633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-26 14:40:47 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 University of Szeged
|
|
|
|
* Copyright (C) 2011 Gabor Loki <loki@webkit.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
|
|
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
|
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2018-10-15 14:24:49 +00:00
|
|
|
#pragma once
|
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ParallelJobs.h: Added.
(WTF::ParallelJobs::ParallelJobs):
(WTF::ParallelJobs::numberOfJobs):
(WTF::ParallelJobs::parameterForJob):
(WTF::ParallelJobs::executeJobs):
* wtf/ParallelJobsGeneric.cpp: Added.
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::executeJob):
(WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
(WTF::ParallelEnvironment::ThreadPrivate::ThreadPrivate):
(WTF::ParallelEnvironment::ThreadPrivate::create):
* wtf/ParallelJobsLibdispatch.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/ParallelJobsOpenMP.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/Platform.h:
* wtf/wtf.pri:
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* ForwardingHeaders/wtf/ParallelJobs.h: Added.
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::PaintingData::PaintingData):
(WebCore::FETurbulence::noise2D):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::fillRegion):
(WebCore::FETurbulence::fillRegionWorker):
(WebCore::FETurbulence::apply):
* platform/graphics/filters/FETurbulence.h:
Canonical link: https://commits.webkit.org/74633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-26 14:40:47 +00:00
|
|
|
|
|
|
|
#if ENABLE(THREADING_LIBDISPATCH)
|
|
|
|
|
|
|
|
#include <dispatch/dispatch.h>
|
|
|
|
|
|
|
|
namespace WTF {
|
|
|
|
|
|
|
|
class ParallelEnvironment {
|
|
|
|
WTF_MAKE_FAST_ALLOCATED;
|
|
|
|
public:
|
|
|
|
typedef void (*ThreadFunction)(void*);
|
|
|
|
|
2011-10-03 13:06:58 +00:00
|
|
|
ParallelEnvironment(ThreadFunction threadFunction, size_t sizeOfParameter, int requestedJobNumber)
|
|
|
|
: m_threadFunction(threadFunction)
|
|
|
|
, m_sizeOfParameter(sizeOfParameter)
|
|
|
|
, m_numberOfJobs(requestedJobNumber)
|
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ParallelJobs.h: Added.
(WTF::ParallelJobs::ParallelJobs):
(WTF::ParallelJobs::numberOfJobs):
(WTF::ParallelJobs::parameterForJob):
(WTF::ParallelJobs::executeJobs):
* wtf/ParallelJobsGeneric.cpp: Added.
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::executeJob):
(WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
(WTF::ParallelEnvironment::ThreadPrivate::ThreadPrivate):
(WTF::ParallelEnvironment::ThreadPrivate::create):
* wtf/ParallelJobsLibdispatch.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/ParallelJobsOpenMP.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/Platform.h:
* wtf/wtf.pri:
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* ForwardingHeaders/wtf/ParallelJobs.h: Added.
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::PaintingData::PaintingData):
(WebCore::FETurbulence::noise2D):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::fillRegion):
(WebCore::FETurbulence::fillRegionWorker):
(WebCore::FETurbulence::apply):
* platform/graphics/filters/FETurbulence.h:
Canonical link: https://commits.webkit.org/74633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-26 14:40:47 +00:00
|
|
|
{
|
2011-10-03 13:06:58 +00:00
|
|
|
// We go with the requested number of jobs. libdispatch will distribute the work optimally.
|
|
|
|
ASSERT_ARG(requestedJobNumber, requestedJobNumber > 0);
|
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ParallelJobs.h: Added.
(WTF::ParallelJobs::ParallelJobs):
(WTF::ParallelJobs::numberOfJobs):
(WTF::ParallelJobs::parameterForJob):
(WTF::ParallelJobs::executeJobs):
* wtf/ParallelJobsGeneric.cpp: Added.
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::executeJob):
(WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
(WTF::ParallelEnvironment::ThreadPrivate::ThreadPrivate):
(WTF::ParallelEnvironment::ThreadPrivate::create):
* wtf/ParallelJobsLibdispatch.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/ParallelJobsOpenMP.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/Platform.h:
* wtf/wtf.pri:
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* ForwardingHeaders/wtf/ParallelJobs.h: Added.
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::PaintingData::PaintingData):
(WebCore::FETurbulence::noise2D):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::fillRegion):
(WebCore::FETurbulence::fillRegionWorker):
(WebCore::FETurbulence::apply):
* platform/graphics/filters/FETurbulence.h:
Canonical link: https://commits.webkit.org/74633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-26 14:40:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int numberOfJobs()
|
|
|
|
{
|
|
|
|
return m_numberOfJobs;
|
|
|
|
}
|
|
|
|
|
|
|
|
void execute(unsigned char* parameters)
|
|
|
|
{
|
2011-10-03 13:06:58 +00:00
|
|
|
static dispatch_queue_t globalQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
|
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ParallelJobs.h: Added.
(WTF::ParallelJobs::ParallelJobs):
(WTF::ParallelJobs::numberOfJobs):
(WTF::ParallelJobs::parameterForJob):
(WTF::ParallelJobs::executeJobs):
* wtf/ParallelJobsGeneric.cpp: Added.
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::executeJob):
(WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
(WTF::ParallelEnvironment::ThreadPrivate::ThreadPrivate):
(WTF::ParallelEnvironment::ThreadPrivate::create):
* wtf/ParallelJobsLibdispatch.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/ParallelJobsOpenMP.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/Platform.h:
* wtf/wtf.pri:
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* ForwardingHeaders/wtf/ParallelJobs.h: Added.
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::PaintingData::PaintingData):
(WebCore::FETurbulence::noise2D):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::fillRegion):
(WebCore::FETurbulence::fillRegionWorker):
(WebCore::FETurbulence::apply):
* platform/graphics/filters/FETurbulence.h:
Canonical link: https://commits.webkit.org/74633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-26 14:40:47 +00:00
|
|
|
|
2011-10-03 13:06:58 +00:00
|
|
|
dispatch_apply(m_numberOfJobs, globalQueue, ^(size_t i) { (*m_threadFunction)(parameters + (m_sizeOfParameter * i)); });
|
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/WTF/WTF.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/ParallelJobs.h: Added.
(WTF::ParallelJobs::ParallelJobs):
(WTF::ParallelJobs::numberOfJobs):
(WTF::ParallelJobs::parameterForJob):
(WTF::ParallelJobs::executeJobs):
* wtf/ParallelJobsGeneric.cpp: Added.
(WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
(WTF::ParallelEnvironment::ThreadPrivate::executeJob):
(WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
(WTF::ParallelEnvironment::ThreadPrivate::workerThread):
* wtf/ParallelJobsGeneric.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
(WTF::ParallelEnvironment::ThreadPrivate::ThreadPrivate):
(WTF::ParallelEnvironment::ThreadPrivate::create):
* wtf/ParallelJobsLibdispatch.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/ParallelJobsOpenMP.h: Added.
(WTF::ParallelEnvironment::ParallelEnvironment):
(WTF::ParallelEnvironment::numberOfJobs):
(WTF::ParallelEnvironment::parameterForJob):
(WTF::ParallelEnvironment::executeJobs):
* wtf/Platform.h:
* wtf/wtf.pri:
2011-04-26 Gabor Loki <loki@webkit.org>
Reviewed by Csaba Osztrogonác.
Speeding up SVG filters with multicore (SMP) support
https://bugs.webkit.org/show_bug.cgi?id=43903
Some SVG filters execute a huge number of pixel manipulations, which
cannot be sped up by graphics accelerators, since their algorithm is
too complex. Using the power of Symmetric Multi Processing (SMP) we
can split up a task to smaller (data independent) tasks, which can be
executed independently.
The ParallelJobs framework provides a simple way for distributed
programming. The framework is based on WebKit's threading infrastructure,
Open Multi-Processing's (OpenMP) API, and libdispatch API.
* ForwardingHeaders/wtf/ParallelJobs.h: Added.
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::PaintingData::PaintingData):
(WebCore::FETurbulence::noise2D):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::fillRegion):
(WebCore::FETurbulence::fillRegionWorker):
(WebCore::FETurbulence::apply):
* platform/graphics/filters/FETurbulence.h:
Canonical link: https://commits.webkit.org/74633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-26 14:40:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
ThreadFunction m_threadFunction;
|
|
|
|
size_t m_sizeOfParameter;
|
|
|
|
int m_numberOfJobs;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace WTF
|
|
|
|
|
|
|
|
#endif // ENABLE(THREADING_LIBDISPATCH)
|