4 ms·
The original Java primitives for concurrency were at a level too low for easy correctness. Threads and Runnables were tedious to use and subject to errors. When
by cratermoon 1y ago
The original Java primitives for concurrency were at a level too low for easy correctness. Threads and Runnables were tedious to use and subject to errors. When Doug Lea's work was incorporated as the java.util.concurrent package in JSR166 the language gained well-defined atomic operations and a medium-level API for developers.
- PaulHoule 1y agoGranted. I think synchronized was not such a great idea, in fact it's a lot like the bad ideas you see in other languages. I was coding Java back when you had to go to NASA's website to get a clear explanation of the module system and we went through all the stages of: "make every method synchronized", "discover a synchronized method call is 6x slower than a plain method call", "have a global discipline for threads and use synchronized concurrently" But that's how Java is different from other languages. When a difficult to fix problem turns up in Java (like the original busted memory model), Java has a solution a decade before C++. Strange and obscure problems in Java are taken seriously whereas PHP, Pyhthon and the like may have the same problem and say "come in, the water's fine"."