7#ifndef PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H
8#define PXR_BASE_WORK_WITH_SCOPED_PARALLELISM_H
13#include "pxr/base/work/api.h"
15#include "pxr/base/tf/pyLock.h"
17#include <tbb/task_arena.h>
21PXR_NAMESPACE_OPEN_SCOPE
103 TF_PY_ALLOW_THREADS_IN_SCOPE();
104 return tbb::this_task_arena::isolate(std::forward<Fn>(fn));
107 return tbb::this_task_arena::isolate(std::forward<Fn>(fn));
123 return std::forward<Fn>(fn)(dispatcher);
128PXR_NAMESPACE_CLOSE_SCOPE
A work dispatcher runs concurrent tasks.
auto WorkWithScopedDispatcher(Fn &&fn, bool dropPythonGIL=true)
Similar to WorkWithScopedParallelism(), but pass a WorkDispatcher instance to fn for its use during t...
auto WorkWithScopedParallelism(Fn &&fn, bool dropPythonGIL=true)
Invoke fn, ensuring that all wait operations on concurrent constructs invoked by the calling thread o...