c++ - Access static constant variable from multiple threads in C -


I have some experience with multithread programming under Linux (C / C + and Android Possix Threads), although sometimes very complex in the most obvious cases, sometimes very complex

In my code I have several constant constant variables (global and function local), can I access them from multiple threads without using mutes? Because I do not modify them, it should be fine, but it is always better to ask.

I have to adapt to heavy speed, so the speed lock as well as mute lock / unlock is quite expensive for me, especially because my application is about to use these variables as a long loop.

If you start them on only one thread and then do not modify them at any time, It should be fine to read concurrently without multiple threads.


Comments