Skip to content

Commit 1e8b21d

Browse files
Make @threads work on array comprehensions
1 parent 38bed82 commit 1e8b21d

File tree

5 files changed

+579
-41
lines changed

5 files changed

+579
-41
lines changed

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ Multi-threading changes
4545
the first time it is called, and then always return the same result value of type `T`
4646
every subsequent time afterwards. There are also `OncePerThread{T}` and `OncePerTask{T}` types for
4747
similar usage with threads or tasks. ([#TBD])
48+
* `Threads.@threads` now supports array comprehensions with syntax like `@threads [f(i) for i in 1:n]`,
49+
filtered comprehensions like `@threads [f(i) for i in 1:n if condition(i)]`, and multi-dimensional
50+
comprehensions like `@threads [f(i,j) for i in 1:n, j in 1:m]` (preserves dimensions). All scheduling
51+
options (`:static`, `:dynamic`, `:greedy`) are supported. Results preserve element order for
52+
`:static` and `:dynamic` scheduling, while `:greedy` returns elements in arbitrary order for
53+
better performance with non-uniform workloads. Non-indexable iterators are also supported. ([#59019])
4854

4955
Build system changes
5056
--------------------

0 commit comments

Comments
 (0)