One annoyance of SwiftConcurrency is that it prioritizes isolation over parallelism in its vocabulary. I want code to run “in the background" AKA “not block the main thread” but all we have is “stuff is isolated or not isolated but no guarantees in what thread it'll end up except if it's MainActor”-concepts.
Like now, I have a nonisolated async function awaiting a ModelActor created in said function, and the model actor code runs on the main thread. In other instances where I do the same thing, it runs in a background thread. Why? I don't know, but the ModelActor doc only says that it “provides mutually exclusive access to attributes of a model” without any other guarantees, so I guess I should expect this to sometimes happen.
https://developer.apple.com/documentation/swiftdata/modelactor
I want more parallelism guarantees, maybe make a BackgroundActor guaranteed to never run on the main thread, possibly using the word “main thread” in the doc.