#include "taskschedulerinternal.h"
#include "../math/emath.h"
#include "../sys/sysinfo.h"
#include <algorithm>
namespace embree
{
RTC_NAMESPACE_BEGIN
static MutexSys g_mutex;
size_t TaskScheduler::g_numThreads = …;
__thread TaskScheduler* TaskScheduler::g_instance = …;
std::vector<Ref<TaskScheduler>> g_instance_vector;
__thread TaskScheduler::Thread* TaskScheduler::thread_local_thread = …;
TaskScheduler::ThreadPool* TaskScheduler::threadPool = …;
template<typename Predicate, typename Body>
__forceinline void TaskScheduler::steal_loop(Thread& thread, const Predicate& pred, const Body& body)
{ … }
void TaskScheduler::Task::run_internal (Thread& thread)
{ … }
dll_export void TaskScheduler::Task::run (Thread& thread) { … }
bool TaskScheduler::TaskQueue::execute_local_internal(Thread& thread, Task* parent)
{ … }
dll_export bool TaskScheduler::TaskQueue::execute_local(Thread& thread, Task* parent) { … }
bool TaskScheduler::TaskQueue::steal(Thread& thread)
{ … }
size_t TaskScheduler::TaskQueue::getTaskSizeAtLeft()
{ … }
void threadPoolFunction(std::pair<TaskScheduler::ThreadPool*,size_t>* pair)
{ … }
TaskScheduler::ThreadPool::ThreadPool(bool set_affinity)
: … { … }
dll_export void TaskScheduler::ThreadPool::startThreads()
{ … }
void TaskScheduler::ThreadPool::setNumThreads(size_t newNumThreads, bool startThreads)
{ … }
TaskScheduler::ThreadPool::~ThreadPool()
{ … }
dll_export void TaskScheduler::ThreadPool::add(const Ref<TaskScheduler>& scheduler)
{ … }
dll_export void TaskScheduler::ThreadPool::remove(const Ref<TaskScheduler>& scheduler)
{ … }
void TaskScheduler::ThreadPool::thread_loop(size_t globalThreadIndex)
{ … }
TaskScheduler::TaskScheduler()
: … { … }
TaskScheduler::~TaskScheduler()
{ … }
dll_export size_t TaskScheduler::threadID()
{ … }
dll_export size_t TaskScheduler::threadIndex()
{ … }
dll_export size_t TaskScheduler::threadCount() { … }
dll_export TaskScheduler* TaskScheduler::instance()
{ … }
void TaskScheduler::create(size_t numThreads, bool set_affinity, bool start_threads)
{ … }
void TaskScheduler::destroy() { … }
dll_export ssize_t TaskScheduler::allocThreadIndex()
{ … }
void TaskScheduler::join()
{ … }
void TaskScheduler::reset() { … }
void TaskScheduler::wait_for_threads(size_t threadCount)
{ … }
dll_export TaskScheduler::Thread* TaskScheduler::thread() { … }
dll_export TaskScheduler::Thread* TaskScheduler::swapThread(Thread* thread)
{ … }
dll_export void TaskScheduler::wait()
{ … }
void TaskScheduler::thread_loop(size_t threadIndex)
{ … }
bool TaskScheduler::steal_from_other_threads(Thread& thread)
{ … }
dll_export void TaskScheduler::startThreads() { … }
dll_export void TaskScheduler::addScheduler(const Ref<TaskScheduler>& scheduler) { … }
dll_export void TaskScheduler::removeScheduler(const Ref<TaskScheduler>& scheduler) { … }
RTC_NAMESPACE_END
}