|
|
|
|
|
by cvwright
1331 days ago
|
|
I really enjoy working in Swift these days, and async/await has been a huge blessing. But the whole way that Actors were rolled out leaves a funny taste. Apple’s main illustrating example for using an Actor was to update a database. But if you try to do that, you run into exactly the same reentrancy issue described in this article! While your Actor function is await’ing on the database, you can have another call to the same function start running, trying to write a different value to the DB. Now you have a race condition — exactly the kind of pain that Actors were supposed to save us from. WTF Apple?!? It would be ok if the first version was presented as a stepping stone to greater things. Instead they piss on our heads and tell us it’s raining. |
|