Producer/Consumer threads using a Queue

前端 未结 7 1712
抹茶落季
抹茶落季 2020-11-22 17:00

I\'d like to create some sort of Producer/Consumer threading app. But I\'m not sure what the best way to implement a queue between the two.

So I\'ve so

7条回答
  •  遇见更好的自我
    2020-11-22 17:41

    You are reinventing the wheel.

    If you need persistence and other enterprise features use JMS (I'd suggest ActiveMq).

    If you need fast in-memory queues use one of the impementations of java's Queue.

    If you need to support java 1.4 or earlier, use Doug Lea's excellent concurrent package.

提交回复
热议问题