Skip to content

Commit fb9f706

Browse files
Make @threads work on array comprehensions
1 parent c2f42a6 commit fb9f706

File tree

5 files changed

+556
-43
lines changed

5 files changed

+556
-43
lines changed

NEWS.md

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

4854
Build system changes
4955
--------------------

0 commit comments

Comments
 (0)