29 ms·
Hint: if your Java concurrency solution doesn't involve java.util.concurrent-you're doing it wrong. Of course pretty much everyone's concurrency solutions do i
by lemming 10y ago
Hint: if your Java concurrency solution doesn't involve java.util.concurrent-you're doing it wrong.
Of course pretty much everyone's concurrency solutions do involve j.u.c since Java 5. They are truly powerful language facilities.
- bsder 10y agoGee, so why do I STILL see so many programmers writing "synchronized" all over their Java or Android code? I wish I were joking. HN is not like the real world. This is just like "git/hg is superior" arguments. Those of us in the real world are still happy when we see a business actually use source control of any form.
- lemming 10y agoUsing synchronised and j.u.c aren't mutually incompatible. It's quite easy to use synchronised to conservatively control access to the state of a single object, and often that's all you need. It can affect performance depending on your access patterns, but it's not like synchronised is deprecated or anything. When was the last time you saw wait/notify? I'm willing to bet that was a long time ago.