this code works for timeDate but if closely check then all 3 consumers are not consuming the same data... there sec value is always diff. I confirmed this by passing the int count value that producer produces... so still all 3 consumers are consumeing diff data. I copied ur code and tested.
what if i have a timeout for each item the producer makes, and i want the consumers to print the item in the same order the items entered the queue? like the threads will have to wait for eachother
How to count total number of producer and consumer
Why notify is used before checking if consumer has any data to consume or not
naiese ackkcentch
Hats off to the clarity.
In which platform u are working or coding in video🤔 name?
netbeans
Surprisingly very easy to understand. Great tut.
this code works for timeDate but if closely check then all 3 consumers are not consuming the same data... there sec value is always diff. I confirmed this by passing the int count value that producer produces... so still all 3 consumers are consumeing diff data.
I copied ur code and tested.
what if i have a timeout for each item the producer makes, and i want the consumers to print the item in the same order the items entered the queue? like the threads will have to wait for eachother
Here the producer class contains the consume method.isn’t that wrong?
What if I wanted to get data from a file? Would i do it in the producer thread then store that in the queue?
Thank you very much
Thank you very much!
great stuff thanks!
I did not understand where is the Problem here...