If you start the first Task withWhat I noticed in playgrounds is that the first Task in the example will just run as early as possible, suggesting concurrent execution. While the second task waits for the isolated function to suspend so it can have access to the actor. I tested this by using print statements and was able to see how behavior become rigidly deterministic when the Task picked up the isolation implicitly via referencing an isolated property. But if the actor’s isolation isn’t required for the Task, it seems to not get it and will run concurrently, making it less deterministic on exactly when it will run as it runs on the global executor’s thread pool.
Task(qos: .background)and the second Task with
Task(qos: .userInitiated), the second task will actually start first. And spraying some
print(Thread.isMainThread)around the code seems to indicate that everything is running in the main thread at all times. If I understood the proposal, this shouldn't be guaranteed to happen, right? The first task may execute somewhere else, since it's not isolated.
I remember Overcast's dev on Twitter saying exactly that.You are better off buying an aftermarket CarPlay display and using that as a test harness in your work office.