views:

182

answers:

1

I'm reading about the Actor Model for a presentation and everyone claimes that it is superior to shared state parallel programming because it avoids many pitfalls like deadlocks and race conditions. I'm asking myself what the specifics of this claims are. If it avoids these problems, how does it do it?

+3  A: 

Your question really contains the answer. The idea is with actors is that they do not share state. Each operates only on its own, private data. Since all data is private, in theory you won't need any locks at all. Without locks, you're obviously immune to problems like deadlock. Without shared data to modify, race conditions are impossible (since no two threads compete over it). Anyway, that's my rosey take on it. Practically speaking, I doubt the actor pattern is a panacea. We'll certainly continue to see some shared state moving forward.

Peter Ruderman