ywkaras commented on PR #9683: URL: https://github.com/apache/trafficserver/pull/9683#issuecomment-1717693712
As we discussed, I investigated the overhead of local static that are dynamically initialized. I looked at the assembler generated by some example code. In this example, if the local static in f() is already initialized, the overhead will be executing instructions on lines 3 through 5 of the assembler code. The mutex locking only comes in if it's not initialized, to avoid a race condition if multiple threads see it as uninitialized, and try to initialize it. https://godbolt.org/z/EjM9jsPz3 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
