如何学习线程,尤其是 Java 中的线程
我一直对线程感到困惑,而我的班级现在大量使用它们。我们正在使用 java.util.concurrent 但我什至没有真正了解基础知识。 UpDownLatch、期货、执行者;这些话就在我的脑海中飞过。你们能建议一些资源来帮助我从头开始了解我需要什么吗?
预先非常感谢!
I have always been kind of confused by threads, and my class right now makes heavy use of them. We are using java.util.concurrent but I don't even really get the basics. UpDownLatch, Futures, Executors; these words just fly over my head. Can you guys suggest any resources to help learn what I need from the ground up?
Thanks a lot in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我假设您已经阅读了 Java 教程的线程章节?
有很多关于线程的好书,但也有专门关于 Java 的线程的书。
例如,Java 并发实践
I'm assuming that you already went through the Java tutorial's threading chapter?
There are many good books on threading in general, but also specifically in Java.
For example, Java Concurrency in Practice
阅读 Brian Goetz 的 “Java 并发实践”。很棒的书。
或者 Doug Lea 的“Java 并发编程”。老派,很棒的东西。早于并发包的日期,但它是许多并发包的基础。
Read "Java Concurrency In Practice" by Brian Goetz. Great book.
Or Doug Lea's "Concurrent Programming In Java". Old school, terrific stuff. Pre-dates the concurrent package, but it's the basis for a lot of it.
如果您正在寻找初学者书籍,请查看 Paul Hyde 的 Java 线程编程。可以阅读其他书籍,例如“Java Concurrency in Practice”和“Concurent Programming in Java”,以深入了解并发性(特别是新的 java.util.concurent API),但对于初学者来说可能不太好。
If you are looking for a beginners book, check out Java Thread Programming by Paul Hyde . The other books like "Java Concurrency in Practice" and "Concurent Programming in Java" can be read to get an in depth understanding of concurrency (and specially the new java.util.concurent API) but may not be good for beginners.