Polyester.jl icon indicating copy to clipboard operation
Polyester.jl copied to clipboard

Disable polyester threads if in an outer @batch loop

Open tetrakai1 opened this issue 8 months ago • 5 comments

The readme gives this example, which works great:

disable_polyester_threads() do
    @threads for i in 1:n
        f()
    end
end

For my use case, I would like to disable an inner @batch in f() if the outer loop uses @batch. Eg,:

disable_polyester_threads() do
    @batch for i in 1:n
        f()
    end
end

Is there an easy way to do this? Thanks.

tetrakai1 avatar Apr 19 '25 23:04 tetrakai1