Deadlock example revisited

So far, we have looked at the actors model at a glance. We have not learned any practical implementations of the actor model just yet. However, it can be instructive to take a look at how our previous example can be implemented so that we are rid of the complexity that we have faced with it.

First of all, we have discussed that actors are primitives of concurrency of the actors model. In the preceding example, the primitives of concurrency were two threads that performed some operations. So, it is reasonable to map the operations that we need to perform from the two threads onto two actors of the actor model. So now, instead of two threads, we have two actors. One actor is supposed to generate JSON from CSV, and ...

Get Mastering Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.