sliver__

[Mastering C++ Programming] - Shared Mutex 본문

CS/C++

[Mastering C++ Programming] - Shared Mutex

sliver__ 2022. 12. 9. 15:48
728x90
  • 공유 뮤텍스 동기화 프리미티브는 공유 및 배타적이라는 두 가지 모드를 지원합니다. 
  • 공유 모드에서 공유 뮤텍스는 데이터 경합 문제 없이 많은 스레드가 동시에 리소스를 공유할 수 있도록 합니다. 
  • 독점 모드에서는 일반 뮤텍스처럼 작동합니다. 
  • 즉, 하나의 스레드만 리소스에 액세스할 수 있습니다. 
  • 리소스에 안전하게 액세스할 수 있는 여러 reader가 있고 하나의 스레드만 공유 리소스를 수정하도록 허용하는 경우 적합한 잠금 기본 요소입니다. 

 

++) Reference

 

https://a-researcher.tistory.com/26

 

[c++] std::shared_mutex

en.cppreference.com/w/cpp/thread/shared_mutex std::shared_mutex - cppreference.com class shared_mutex; (since C++17) The shared_mutex class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multipl

a-researcher.tistory.com

 

728x90
Comments