Home > Back-end > Consult a multi-threaded locking problems
Consult a multi-threaded locking problems
Time:10-20
Multi-threaded programs, including a 1 thread used for initialization data regularly, and multiple threads access initialization good data, I think at the time of initialization, other threads can not access the program, but the data initialization is completed, other threads can be unlocked when access to the data, because the lock can lead to access between threads mutexes, this how to design? Visit other threads consistent open, cannot be stopped
CodePudding user response:
Initializes the lock, it is no problem, But multithreaded access cannot lock at the same time? Determine all read-only access? All is read-only access can be unlocked,