How to enforce spawned tasks to be run on different threads?

I could not achieve full parallelism with ThreadPools.tmap or ThreadPools.tforeach, though I succeeded using Threads.@threads for (see below).

for i in 1:2 # Say we do two iterations
    println("Iteration $i")
    Threads.@threads for _ in 1:4
        mytask()
    end
end

However, this forces the user to have a single outer for loop encompassing the multithreaded code. Less convenient than @spawn IMO. This would be a problem with nested multithreaded for loops for instance. I’d be interested in achieving fully parallelized code using something like @spawn. I remember being able to do that with apply_async in python, by creating a pool of jobs wherever I wanted in nested for loops and “getting” them afterwards (executing the threads and fetching the results).

Yes I would like this! However my tasks are pretty long and of similar length. I’d be happy just to be able to run the 25 threads in parallel.