[asterisk-dev] Regarding Unique Id In Logs

Balraj Singh balraj.singh at zemosolabs.com
Wed Jul 4 07:41:50 CDT 2018


Sorry the reference link is wrong in my last mail.
Correct one : [1]
<https://www.embedded.com/electronics-blogs/beginner-s-corner/4023801/Introduction-to-the-Volatile-Keyword>

Thank you.

On Wed, Jul 4, 2018 at 6:10 PM Balraj Singh <balraj.singh at zemosolabs.com>
wrote:

> 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.
>
> 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 ).
>
> Please correct me if I'm wrong here.
> @Richard Mudgett : Please validate the changes I did.
> [1]
> <https://docs.google.com/presentation/d/11LC-_e1EGL3X-n7gU_Z2uSNvPX41t6LVngO9AxBi4wo/edit?usp=sharing>
>
> Thank you all.
>
>

-- 
*Thanks, *
*Balraj.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20180704/d72c2f31/attachment.html>


More information about the asterisk-dev mailing list