|
|
|
|
|
by bsaul
1777 days ago
|
|
After having tried to follow the discussions on swift forums on concurrency and actors, i still couldn't make my mind on whether their design was "fancy" smart (aka : something subtle and brilliant, that few developpers will get their grasp on and lead to inscrutable concurrency bugs), or "stupid" smart (aka : take a complex problem and make it look simple). Actors in systems like erlang seem to make concurrency simple, and the model seems to be easy to grasp. On the contrary, a few code samples i've seen on swift forums made my mind twist trying to understand how the code was going to be executed.. |
|
This is why `await` is such an important keywords to litter around your code - anything can happen in between when you await and when you come back, including actor message processing. You could have another invocation against your actor instance happen in tandem.
This definitely increases the learning curve, but likely still saves time later when you are fighting various deadlock conditions.