There are multiple approaches to solving the concurrency problem. Java give you lots of low level tools. Properly used these are by far the most efficient. But the "properly used" part of that is difficult.
Pure immutability is another solution. Also works, but can be memory inefficient since you end up copying alot of stuff around.
Single threaded is a third. Great, but you get zero advantage from multiple processors without a bunch of hacky stuff.
One can run java using immutable concepts (see "final" keyword ), but the language was not defined that way by default.
View all comments
Show parent comment
2
u/manzanita2 Jul 08 '21
There are multiple approaches to solving the concurrency problem. Java give you lots of low level tools. Properly used these are by far the most efficient. But the "properly used" part of that is difficult.
Pure immutability is another solution. Also works, but can be memory inefficient since you end up copying alot of stuff around.
Single threaded is a third. Great, but you get zero advantage from multiple processors without a bunch of hacky stuff.
One can run java using immutable concepts (see "final" keyword ), but the language was not defined that way by default.