馬士兵高併發編程筆記四之生產者/消費者

寫一個固定容量的同步容器,擁有put和get方法,以及getCount方法,可以支持2個生產者線程以及10個消費者線程的阻塞調用java 有以下兩種方法實現:web 1. 使用 wait 和 notify / notifyAll public class MyContainer1<T> { final private LinkedList<T> lists = new LinkedList
相關文章
相關標籤/搜索