|
|
|
|
|
by Guvante
1657 days ago
|
|
What are you CASing? If the object is too large you will have contention to the point that you might as well be single threaded. If the object is too small you now have to CAS multiple things which is far from trivial. CAS is a primitive, it isn't complex itself but it can be complex to work with once you are talking non trivial work. Just like locks. A global lock is dumb simple but a real locking system can be as complex as you will let it. |
|
Right but both of those things are true for locks too right? CAS seems no harder than locks.