One of my friends had faced this problem during his interview in Subex. Concept is pretty simple here. We have two threads here. Consumer thread can not consume anything unless and until Producer Thread has produced.
There are couple of ways to solve this problem. Here I am using volatile Stack to solve this.
There are couple of ways to solve this problem. Here I am using volatile Stack to solve this.
No comments:
Post a Comment