多线程同步的OO设计模式
给定设计模式名称时,是否有对象、数据和线程交互的概括?
显然,经常发生的是对象上的同步、通过队列传递消息以及内存管理系统中的引用计数。
但是,还有更多面向 OO 的多线程设计模式和系统的名称能够清楚地体现最佳实践吗?
Are there any generalisations of object and data and thread interactions given design pattern names?
Obviously what goes on a lot is synchronisation on an object, passing messages through a queue and also reference counts in memory management systems.
But are there any more OO-oriented names for multithreading design patterns and systems that cleanly embody best practice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Schmidt、Stal、Rohnert 和 Buschmann 所著的“面向模式的软件架构第 2 卷:并发和网络对象的模式”列出了一些内容。 Douglas Schmidt 也是 ACE C++ 框架 的作者,该框架将这些模式引入实践。
"Pattern-oriented Software Architecture Vol 2: Patterns for Concurrent and Networked Objects" by Schmidt, Stal, Rohnert and Buschmann lists some. Douglas Schmidt is also the author of the ACE C++ framework which brings those patterns into practice.
生产者-消费者是处理多线程环境的交互设计模式之一数据同步。
Producer - Consumer is one of those interaction design patterns for multi-threaded environments that deals with data-synchronization.
如果您正在考虑像 Latch、Barrier 或 Semaphore 这样的野兽,请查看 java.util.concurrent 包的文档(例如,请参见此处:http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent /package-tree.html )
If you are thinking of beasts like Latch, Barrier or Semaphore take a look at the documentation for java.util.concurrent package (see here for example: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/package-tree.html )
维基百科上的并发模式。
Concurrency Patterns on wikipedia.