Single-threaded design patterns

Contains elements: gate, user, and client, where the client can go to create a door and people, the door is the need to give the shared data

door

 

 

 

 

 

 Problem: The above features in a multi-threaded, the name and address does not respond, because multiple threads to access the same resources caused by gate

Solution:

 

 Separate write lock

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/zj-xu/p/11876099.html