O'Reilly logo

Scala Functional Programming Patterns by Atul S. Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

We had a whirlwind tour of concurrency mechanisms. It started with the producer/consumer pipeline of Unix. Then we saw the inherent principles behind the pipeline, namely decoupling and each tool doing at least one thing. This is the essential Unix philosophy.

We looked at the recursive grep worker as an example. After the pipeline solution, we looked at the producer/consumer implementation in Java. We looked at the problems of performing multithreading by ourselves. We also saw how we need to take extreme care not to introduce race conditions.

Races can take place when there is a possibility of the same state getting updated by multiple threads. We saw one example of a leaky abstraction and how immutability helps us gain the ground back. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required