Replies: 1 comment 2 replies
-
Good question! It's true that if you can create the But if you cannot create the tasks synchronously, the changes to the If you need to preserve FIFO ordering, you have to think about how it's going to happen. It could be that the changes to Swift 6 will do it. But, if not, you'll still need a queue of some kind. However, often a plan old |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If my understanding is correct, Swift 6 now ensures Tasks will be executed in the order they are created, as long as the Tasks are all created in the same "context" (In the same actor or in outside of any actor (in which case they will be executed in the global executer. I guess?) So in any case, if we have a bunch of Tasks like this
Then they will always be executed in the right order. As mentioned here
The article says
"...Update: Swift 6 has strengthened the ordering guarantees of Task via the @isolated(any) attribute. This makes a big difference, but the general problems here are still applicable..."
Please can someone explain what those "general problems" are that are "still applicable"?
I guess that order will only be FIFO if the priorities are equal. So is any any advantage in using this Queue unless we need to execute blocks with different priorities and still want to preserve order?
Beta Was this translation helpful? Give feedback.
All reactions