|
|
|
|
|
by drtse4
86 days ago
|
|
A huge mistake, I've seen a lot of code where clearly the author thought that just adding "synchronized" would have solved any concurrency issue. And no one even talks about how synchronized is implemented, basically a monitor on the object. The point of view is usually also wrong, they focus on the method call flow while they should think about protecting access to shared data. |
|
As I said, I feel like when I reach for a lock, about 95% of the time it’s because I don’t really understand the problem well enough.