logoalt Hacker News

terafloptoday at 3:16 PM4 repliesview on HN

I am surprised that you had to go out of your way to remove Thread.stop from existing Java code. It's been deprecated since 1998, and the javadoc page explains pretty clearly why it's inherently unsafe.

It's hard to miss all the warnings unless you're literally just looking at the method name and nothing else.


Replies

kelnostoday at 6:24 PM

Not to mention that I feel like it's pretty unusual to be creating and managing threads yourself in Java these days, instead of using a thread pool/executor.

pjc50today at 3:19 PM

I was certainly surprised to see it when I found it.

wiseowisetoday at 4:53 PM

That’s barely-junior interview question indeed.

AtlasBarfedtoday at 6:19 PM

One of Java's the ecosystem fundamental platforms is that it's multi-threading. It's gone through too many models.

And since Java has a metric ton of blog posts from the 2000s and 2010s, a lot of search engines lead you to older models.java itself has gone from green threads to OS threads and back to green threads now.