Salil Vverma wrote:Hey Anuj,
I tried the solution is quad code processor and found it working fine. But definitely the code is prone to dead lock if first signal from main to first thread gets missed. The chances of single getting missed will increase in a single core processor machine.
The problem can be solved using Semaphore. The complete code can be accessed from the below link -
http://jyotisalil.blogspot.in/2013/09/inter-thread-communication-using-wait_19.html#SemaphoreCode
Salil Vverma wrote:Anuj : We can implement the solution with lock and condition but I think, we shall have to add unnecessary complexity to make sure that no signal gets missed in that solution.