|T1||Acts as a producer to put element in Queue.after it puts,it will notify T2 about it and wait till T3 consumes the element(T1 will get notification for the same from T3.)|
|T2||Acts as a mediator,informs T3 that Queue has been filled,it will wait till T1 notify it and after getting notified T2 will propogate this notification to T3.|
|T3||Acts as a consumer,after it get notified by T2,it needs to consume element from queue and inform about this to T1,it will wait till it is notified by T2.|
raja singh kumar wrote:
I was also asking if it is possible to share a value across classes also in another post. But I am still not clear how to do it.
raja singh kumar wrote:This is what I have. Please let me know where I am going wrong.
raja singh kumar wrote:My requirement is:
There are three threads T1, T2, T3. We need to have a queue. Thread T1 puts one value into the queue. There will always be only one value in the queue. Whenever thread T1 changes the value in the queue, thread T2 is supposed to inform thread T3 and thread T3 must output the value in the queue
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earthhttps://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter