|
54 | 54 | // do something
|
55 | 55 | }
|
56 | 56 | ```
|
| 57 | +* [SE-0461][]: |
| 58 | + Nonisolated asynchronous functions may now execute on the calling actor, when the upcoming feature `NonisolatedNonsendingByDefault` |
| 59 | + is enabled, or when explicitly opted-into using the `nonisolated(nonsending)` keywords. This allows for fine grained control |
| 60 | + over where nonisolated asynchronous functions execute, and allows for the default behavior of their execution to be changed |
| 61 | + from always executing on the global concurrent pool, to the calling actor, which can yield noticeable performance improvements |
| 62 | + thanks to less executor hopping when nonisolated and isolated code is invoked in sequence. |
| 63 | + |
| 64 | + This also allows for safely using asynchronous functions on non-sendable types from actors, like so: |
| 65 | + |
| 66 | + ```swift |
| 67 | + class NotSendable { |
| 68 | + func performSync() { ... } |
| 69 | + |
| 70 | + nonisolated(nonsending) |
| 71 | + func performAsync() async { ... } |
| 72 | + } |
| 73 | + |
| 74 | + actor MyActor { |
| 75 | + let x: NotSendable |
| 76 | + |
| 77 | + func call() async { |
| 78 | + x.performSync() // okay |
| 79 | + |
| 80 | + await x.performAsync() // okay |
| 81 | + } |
| 82 | + } |
| 83 | + ``` |
57 | 84 |
|
58 | 85 | * The Swift compiler no longer diagnoses references to declarations that are
|
59 | 86 | potentially unavailable because the platform version might not be new enough
|
@@ -10837,6 +10864,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
|
10837 | 10864 | [SE-0442]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0442-allow-taskgroup-childtaskresult-type-to-be-inferred.md
|
10838 | 10865 | [SE-0444]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md
|
10839 | 10866 | [SE-0458]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0458-strict-memory-safety.md
|
| 10867 | +[SE-0461]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0461-async-function-isolation.md |
10840 | 10868 | [SE-0462]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0462-task-priority-escalation-apis.md
|
10841 | 10869 | [SE-0469]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0469-task-names.md
|
10842 | 10870 | [SE-0470]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0470-isolated-conformances.md
|
|
0 commit comments