Netcracker Technology interview question

Write a Thread implementing producer-consumer scenario.