3 ms·
A simple way to avoid the problems highlighted in the article is to use immutable data-structures. If you need to update that across threads, am atom with CAS l
by beders 6y ago
A simple way to avoid the problems highlighted in the article is to use immutable data-structures.
If you need to update that across threads, am atom with CAS logic will usually be sufficient.
If you like it erlang style: an agent can serialize changes nicely.
If you need coordinated changes, use software transactions.
Of course: next we'll introduce deadlocks with DB transactions. Fun!