Introduction - If you have any usage issues, please Google them yourself
linux multi-thread synchronization
Threads share the same memory operation, there will be multiple threads use the same resources to do this, you need to synchronize these threads to ensure that when they access the shared memory does not have access to an invalid value.