<div dir="ltr">Sorry the reference link is wrong in my last mail.<div>Correct one : <a href="https://www.embedded.com/electronics-blogs/beginner-s-corner/4023801/Introduction-to-the-Volatile-Keyword">[1]</a></div><div><br></div><div>Thank you.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 4, 2018 at 6:10 PM Balraj Singh <<a href="mailto:balraj.singh@zemosolabs.com">balraj.singh@zemosolabs.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I know the working of static variables in Multi-threaded environment, but I never used static variables ( please check the code sent in one of my previous reply ) to save the unique-id. I'm using volatile keyword which is completely different from static variable ( one of the storage classes in c ), and the usage of volatile keyword here is to tell the compiler to not perform optimisation ( while compilation ) on this variable. This is useful in multi-threaded environment, as in global variable should be declared volatile[1] in this type of environment for shared global variables. <div><br></div><div>Regarding the second comment about unique-id being whatever at some point of time : let me clear this thing, I already stated in my last reply that I'm getting unique-id ( belonging to a call ) in logs correctly even in concurrent calls ( tested with more than 1 call ).</div><div><br></div><div>Please correct me if I'm wrong here. </div><div>@Richard Mudgett : Please validate the changes I did. </div><div><a href="https://docs.google.com/presentation/d/11LC-_e1EGL3X-n7gU_Z2uSNvPX41t6LVngO9AxBi4wo/edit?usp=sharing" target="_blank">[1]</a></div><div><br></div><div>Thank you all.</div><div><br></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b><font color="#666666">Thanks, </font></b><div><span style="background-color:rgb(255,255,255)"><b><font color="#666666">Balraj.</font></b></span></div></div></div>