Please, visit me for some cool tech post at www.ourdailycodes.com
Please, visit me for some cool tech post at www.ourdailycodes.com
Steve
Please, visit me for some cool tech post at www.ourdailycodes.com
Please, visit me for some cool tech post at www.ourdailycodes.com
Steve
Manoj Kulkarni wrote:They are together. Its addition to queue first and then atomic int is increased.
Steve
Steve
Manoj Kulkarni wrote:Just to clear my understanding here. Refer my queuethread class. It is a thread so in that 1st operation is add and next operation is atomicinteger increment. Now when 100 threads are fired parallely, you mean to say that there is possibility of add queue later and atomic int increment first in same thread. Because please note that as part of operation add queue and increment atomic int are sequential and not parallel activities.
Steve
Manoj Kulkarni wrote:I have a new concern now. Considering the theory of memory model, queue.add should get executed under any circumstances may be after atomicinteger has incremented.
But there is no evidence of queue.add call being made but there is evidence of atomicinteger increment. Is it possible to miss the entire call in above prototype.
Steve
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|