r/java • • Mar 14 '18

Concurrent Java: Low scalability, the risk of deadlocks or garbage creation, you can not avoid all

http://vmlens.com/articles/tradeoffs_concurrent_programming/
2 Upvotes

21 comments sorted by

View all comments

0

u/[deleted] Mar 14 '18

[deleted]

1

u/duhace Mar 14 '18

Why would "modifying immutable state consists of copying the immutable object"? Immutable state enables structural sharing, i.e., just reusing the existing state and adding on the delta from the modification.

it depends on the immutable object and how you modify it. for example, immutable singly linked lists don't require a copy if you add to the head of the list, but do if you add to the tail.

0

u/[deleted] Mar 14 '18

[deleted]

1

u/0x256 Mar 14 '18

I'd be interested in an immutable list data structure that does not need a copy for append/perpend operations and is not a linked-list. It's easy you say?