23 ms·
I'd hazard a guess that 0.1% of Java developers are aware that on some operating systems Object.wait() can awaken spuriously. Heck, it wasn't even in the Javado
by user1980 7y ago
I'd hazard a guess that 0.1% of Java developers are aware that on some operating systems Object.wait() can awaken spuriously. Heck, it wasn't even in the Javadoc until 1.5. And don't even get me started on how you should handle an InterruptedException.
Most Java developers I know consider rolling your own multi-threading scheme about as wise as rolling your own cryptography, and just pretend notify/notifyAll/wait don't even exist.
- Bartweiss 7y agoIronically, that's one of the few things I do know off the top of my head about Object.wait(). I'm far from an expert on Object's threading methods, but "this will burn you, don't try it" is becoming more pervasive than "here's how to do this". Which is almost certainly the right order to learn those things in.