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

add `@maybe_threads`

Open IanButterworth opened this issue 2 years ago • 1 comments

So instead of

if threading
    @threads for x in y
        foo etc.
    end
else
    for x in y
        foo etc.
    end
end

you can do

@maybe_threads threading for x in y
    foo etc.
end

Todo:

  • [ ] Handle schedule arg
  • [ ] Add tests
  • [ ] Add docs

IanButterworth avatar Sep 27 '23 12:09 IanButterworth

cool :tada: I've wanted something like this for a long time :)

baggepinnen avatar Sep 27 '23 12:09 baggepinnen