OO design patterns for multi-threaded synchronisation
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 开发者_StackOverflow社区systems.
But are there any more OO-oriented names for multithreading design patterns and systems that cleanly embody best practice?
"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.
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.
精彩评论