| ▲ | koakuma-chan 2 hours ago | |
So you're just using actors to limit concurrency? Why not use a mutex? | ||
| ▲ | raphinou 2 hours ago | parent | next [-] | |
This might be a question of personal preference. At the design stage I already find it more approachable to think in separated responsibilities, and it naturally translates to actors. Thinking about the app, it's much reasier for me to thin "send the message to the actor" than call that function that uses the necessary mutex. With mutexes, I think the separation of concerns is not as strong, and you might end up with a function taking multiples mutexes that might interfere. With the actor model, I feel there is less risk (though I'm sure this would be questioned by seasoned mutex users). | ||
| ▲ | rurban 23 minutes ago | parent | prev [-] | |
Because actors were invented to overcome deadlocks caused by mutexes. See page 137. With mutexes you can forget concurrency safety. | ||