Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the weaknesses in using Immutability + Actor model for concurrency programming?

While building a large multi threaded application for the financial services industry, I utilized immutable classes and an Actor model for workflow everywhere I could. I'm pretty pleased with the outcome. It uses a fair amount of heap space (its in Java btw) but the JVM's GC works pretty well with short lived immutable classes.

I am just wondering if there are any downsides to using this kind of pattern going forward? When debugging a team mates code, I often find myself recomending this pattern in one way or another. I guess once one has a hammer, everything looks like a nail. So the question is: When would this design pattern (paradigm?) work poorly?

My hunch is when memory usage is a big issue or when the project restrictions require something along the lines of low-level C, etc.

like image 405
user992592 Avatar asked Oct 13 '11 02:10

user992592


1 Answers

Many science simulations codes are really memory intensive. For example for cellular automata models fast memory access is more important than CPU power. In that case, accessing and modifying in place a mutable array is always faster (at least in all my trials).

like image 96
paradigmatic Avatar answered Sep 27 '22 20:09

paradigmatic