https://github.com/JuliaLang/julia
Raw File
Tip revision: 96b96c8d5195b968656e786ded8f6a1a96168427 authored by Jishnu Bhattacharya on 20 March 2024, 18:20:09 UTC
Add `promote_rule` for OneTo and AbstractUnitRange
Tip revision: 96b96c8
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