https://github.com/JuliaLang/julia
Raw File
Tip revision: a7e1ec0dc4519f9f196e4b7f13bae7e538872319 authored by KristofferC on 12 May 2023, 10:57:45 UTC
ensure zones are reallocated in new processes
Tip revision: a7e1ec0
profile_spawnmany_exec.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Profile

function spawnmany(n)
    if n > 2
        m = n รท 2
        t = Threads.@spawn spawnmany(m)
        spawnmany(m)
        wait(t)
    end
end

@profile spawnmany(parse(Int, get(ENV, "NTASKS", "2000000")))
back to top