java.util.concurrent 、示例、教程和代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4208208/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 05:19:31  来源:igfitidea点击:

java.util.concurrent , examples, tutorial and code

javamultithreadingconcurrency

提问by The Unix Janitor

I've been ask to build a multi-threaded java application using the java.util.concurrentlibrary. I'm not familiar with this library, but have a good understanding of problems with multi-threaded code.

我一直在要求使用该java.util.concurrent库构建一个多线程 java 应用程序。我不熟悉这个库,但对多线程代码的问题有很好的理解。

I'm looking for a tutorial and example code that shows this java library in use and it's best practises.

我正在寻找一个教程和示例代码,它显示了这个正在使用的 java 库和它的最佳实践。

回答by Carlos

If you are a fast learner, I recommend the site www.java2s.com (Java API by Example).

如果您是一个快速学习者,我推荐网站 www.java2s.com(Java API by Example)。

Here's the full link for the concurrent package: http://www.java2s.com/Code/JavaAPI/java.util.concurrent/Catalogjava.util.concurrent.htm

这是并发包的完整链接:http: //www.java2s.com/Code/JavaAPI/java.util.concurrent/Catalogjava.util.concurrent.htm

EDIT: If you can spend some cash (and isn't in a hurry), I recommend this book: Java Concurrency in Practice http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601/ref=sr_1_1?ie=UTF8&qid=1290021702&sr=8-1

编辑:如果您可以花一些现金(并且不着急),我推荐这本书:Java 并发实践 http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601 /ref=sr_1_1?ie=UTF8&qid=1290021702&sr=8-1

It is really full of examples and good practices.

它确实充满了示例和良好实践。

回答by AlexR

I usually prefer to learn from the primary source and recommend this one: http://download.oracle.com/javase/tutorial/essential/concurrency/index.html

我通常更喜欢从主要来源学习并推荐这个:http: //download.oracle.com/javase/tutorial/essential/concurrency/index.html

Also I like very much book "Thinking in Java" by Bruce Eckel

我也非常喜欢 Bruce Eckel 的书“Thinking in Java”

回答by Anton Shchastnyi

You can try my brief noteson the subject (it's only 10 pages). I've made this quick tutorial after reading some articles alongside with javadoc for java.util.concurrent.

你可以试试我关于这个主题的简短笔记(它只有 10 页)。在阅读了一些文章以及 java.util.concurrent 的 javadoc 后,我制作了这个快速教程。

回答by robbbert

Vogella's Java Concurrency / Multithreading Tutorial

Vogella 的Java 并发/多线程教程

Covers the basics (immutable data structures) and all relevant technologies - from Threads over the (Java 6, java.util.concurrent) Executorframework, and Futures/Callables, to the (coming Java 7) fork/joinframework.

涵盖基础知识(不可变数据结构)和所有相关技术 - 从Thread(Java 6、java.util.concurrentExecutor框架和Futures/ Callables 到(即将推出的 Java 7)fork/join框架。

20 printed pages, not the best English, but to the point.

20页印刷品,不是最好的英文,但切中要害。

回答by Nazgul

checkout this post. It explains the basics of concurrent design very well.

结帐这个帖子。它很好地解释了并发设计的基础知识。

http://walivi.wordpress.com/2013/08/24/concurrency-in-java-a-beginners-introduction/

http://walivi.wordpress.com/2013/08/24/concurrency-in-java-a-beginners-introduction/