Java线程池

发布于 2024-08-24 08:35:19 字数 1536 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

柠檬 2024-08-31 08:35:19

看看 Doug Lea 的书……它们现在已经相当老了(除非他发布了新书,不确定),但是 1.5 中添加的并发包是基于他的线程库的。就我而言,他是 Java 并发编程方面的权威...他的书将为您提供完成此任务所需了解的基础知识。

我只能假设这是一项学术练习...如果不是,我强烈建议您坚持使用并发包,因为它经过了良好的测试和良好的开发...不要重新发明轮子。祝你好运。

take a look at Doug Lea's books... they are fairly old now (unless he released a new one, not sure), but the concurrent package added in 1.5 is based on his threading libraries. as far as i am concerned, he is the authority on concurrent programming in java... his books will give you the basics of what you need to understand to accomplish this task.

i can only assume this is an academic exercise... if not, i would strongly recommend you stick to the concurrent package as it is well-tested and well-developed... don't re-invent the wheel. good luck.

猫烠⑼条掵仅有一顆心 2024-08-31 08:35:19

我绝对推荐阅读“实践中的并发”。这是处理 Java 线程问题的第一本书。

I definitely recommend reading "concurrency in practice". It's the number one book dealing with threading issues in Java.

冷︶言冷语的世界 2024-08-31 08:35:19

您可以查看 ThreadPoolExecutor 来自核心java。但你为什么要重新发明轮子呢?

You could have a look at the source code for ThreadPoolExecutor from core java. Though why do you want to reinvent the wheel?

眼泪淡了忧伤 2024-08-31 08:35:19

我同意不需要重新发明轮子,我们应该坚持执行器框架。但即使我也很好奇 Executor 框架中线程池是如何实现的。

发现这个有趣的链接,其中讨论了如何使用线程以自定义方式实现线程池:http://www.ibm.com/developerworks/library/j-jtp0730/index.html

I agree that re-inventing wheel is not required and we should stick to Executor framework. But even i was curious to know how thread pool is implemented in Executor framework.

found this interesting link which talks how thread pool can be implemented in custom way using threads : http://www.ibm.com/developerworks/library/j-jtp0730/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文