Producer Consumer pattern is classic multi-threading pattern which offers several benefits in terms of better code organization, independent development of producer and consumer and less coupling between them. with introduction of BlockingQueue in java its now become even easier to implement this pattern.

read full post : Producer Consumer solution using blocking Queue in java