Java threads for the beginner [closed]
I've been trying to explain Java threading to a colleague who has never been exposed to multi-threaded applications, but apparently I'm not a very good teacher.
Can anyone recommend a good online or offline resource that can explain threading in a simple, step-by-step manner? I know it's a complex topic, but surely there exists an article, book, o开发者_如何学编程r other explanation that can result in an "Aha! I get it, finally!" moment.
Take a look at the Concurrency lesson in Sun's Java Tutorials. It's kind of big, but it's broken up nicely.
I would point him in the direction of the official tutorial, where this subject is discussed here.
It was the official java tutorial that got me started, and I'm not even a serious Java developer...
apart from the offical sun tutorial you may check these out
http://www.devshed.com/c/a/Java/The-Basics-of-Multiple-Threads-in-Java/
http://www.javabeginner.com/learn-java/java-threads-tutorial
Here is an old but good one, got me the Aha, I get it effect
http://www.javaworld.com/javaworld/jw-04-1996/jw-04-threads.html
After the simple tutorials, I strongly recommend getting Brian Goetz's book "Java Concurrency in Practice" if the colleague might pursue multi-threaded programming.
If you're using Swing also check SwingWorker:
http://java.sun.com/docs/books/tutorial/uiswing/concurrency/worker.html
精彩评论