Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
concurrent.cpp File Reference
#include "Utility/Concurrent/concurrent.h"
#include "Utility/Concurrent/FixedSizeThreadPool.h"
#include "Math/math.h"
#include <Common/assertion.h>
#include <functional>
#include <cstddef>
#include <thread>

Namespaces

namespace  ph
 The root for all renderer implementations.
 

Functions

void ph::parallel_work (const std::size_t numWorkers, std::function< void(std::size_t workerIdx) > work)
 Runs specified works in parallel. The function will block the calling thread until all works are complete.
 
void ph::parallel_work (const std::size_t totalWorkSize, const std::size_t numWorkers, std::function< void(std::size_t workerIdx, std::size_t workBegin, std::size_t workEnd) > work)
 Runs specified works in parallel. The function will block the calling thread until all works are complete. Note that 0-sized works are not executed (work is not called in this case).
 
void ph::parallel_work (FixedSizeThreadPool &workers, const std::size_t totalWorkSize, std::function< void(std::size_t workerIdx, std::size_t workBegin, std::size_t workEnd) > work)
 Runs specified works in parallel using a thread pool. The function will block the calling thread until all works are complete. Note that 0-sized works are not executed (work is not called in this case).