[asterisk-dev] Regarding Unique Id In Logs

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


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20180704/92330f0a/attachment.html>


More information about the asterisk-dev mailing list