Skip to content

Commit 92d0d29

Browse files
authored
add task executors to changelog (#71487)
1 parent 4560e19 commit 92d0d29

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@
44
> This is in reverse chronological order, so newer entries are added to the top.
55

66
## Swift 5.11
7+
* [SE-0417][]:
8+
Tasks now gain the ability to respect Task Executor preference.
9+
This allows tasks executing default actors (which do not declare a custom executor),
10+
and nonisolated asynchronous functions to fall back to a preferred executor, rather than always
11+
executing on the default global pool.
12+
13+
The executor preference may be stated using the `withTaskExecutorPreference` function:
14+
15+
```swift
16+
nonisolated func doSomething() async { ... }
17+
18+
await withTaskExecutorPreference(preferredExecutor) {
19+
doSomething()
20+
```
21+
22+
Or when creating new unstructured or child-tasks (e.g. in a task group):
23+
24+
```swift
25+
Task(executorPreference: preferredExecutor) {
26+
// executes on 'preferredExecutor'
27+
await doSomething() // doSomething body would execute on 'preferredExecutor'
28+
}
29+
```
730

831
* [SE-0413][]:
932

@@ -10080,6 +10103,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
1008010103
[SE-0397]: https://github.com/apple/swift-evolution/blob/main/proposals/0397-freestanding-declaration-macros.md
1008110104
[SE-0407]: https://github.com/apple/swift-evolution/blob/main/proposals/0407-member-macro-conformances.md
1008210105
[SE-0411]: https://github.com/apple/swift-evolution/blob/main/proposals/0411-isolated-default-values.md
10106+
[SE-0417]: https://github.com/apple/swift-evolution/blob/main/proposals/0417-task-executor-preference.md
1008310107
[SE-0412]: https://github.com/apple/swift-evolution/blob/main/proposals/0412-strict-concurrency-for-global-variables.md
1008410108
[SE-0413]: https://github.com/apple/swift-evolution/blob/main/proposals/0413-typed-throws.md
1008510109
[#64927]: <https://github.com/apple/swift/issues/64927>

0 commit comments

Comments
 (0)