-
A third party library requires me to implement an interface for it to submit jobs to run in parallel. It looks like this: class JobSystem
{
public:
virtual void QueueJob(Job*) = 0;
virtual void WaitForJobs() = 0;
}; I would like to implement this interface on top of Rayon, as I already use Rayon for unrelated parallel work and they can use the same thread pool.
As far as I understand, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Apparently |
Beta Was this translation helpful? Give feedback.
Apparently
rayon_core::yield_now
exists. Calling it in a loop until the jobs are done should do the trick. If it returnsYield::Idle
then wait for the jobs to finish with a small timeout.