I’m not sure I understand. What is the connection between references and deadlocks?
> On Aug 25, 2017, at 1:07 PM, Marc Schlichte <[email protected]> > wrote: > > >> Am 25.08.2017 um 19:08 schrieb Adam Kemp via swift-evolution >> <[email protected] <mailto:[email protected]>>: >> >> I understand what you’re saying, but I just think trying to make >> synchronous, blocking actor methods goes against the fundamental ideal of >> the actor model, and it’s a recipe for disaster. When actors communicate >> with each other that communication needs to be asynchronous or you will get >> deadlocks. It’s not just going to be a corner case. It’s going to be a very >> frequent occurrence. >> >> One of the general rules of multithreaded programming is “don’t call unknown >> code while holding a lock”. Blocking a queue is effectively the same as >> holding a lock, and calling another actor is calling unknown code. So if the >> model works that way then the language itself will be encouraging people to >> call unknown code while holding locks. That is not going to go well. >> > > I would claim - without having a prove though - that as long as you don’t > invoke async actor methods on weak or unowned actor references and the code > is retain cycle free, no deadlocks will happen. > > Cheers > Marc >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
