aquemini
aquemini

Reputation: 960

Compound Producer-Consumer in Java

I have a relationship that must work as follows; thread A publishes some change to thread B, who takes that change and publishes it to thread C.

The problem is producer-consumer, and I have no problem using a BlockingQueue to implement it with only two entities. How can I make thread B a sort of hybrid producer and consumer to make this work? As in, is there some specified model to follow for problems in this genre?

Upvotes: 0

Views: 91

Answers (1)

Ted Hopp
Ted Hopp

Reputation: 234807

Use two blocking queues: one between A and B; the other between B and C.

Upvotes: 2

Related Questions