블로그 이미지
평범하게 살고 싶은 월급쟁이 기술적인 토론 환영합니다.같이 이야기 하고 싶으시면 부담 말고 연락주세요:이메일-bwcho75골뱅이지메일 닷컴. 조대협


Archive»


 

'readers-writer lock'에 해당되는 글 1

  1. 2014.01.02 mongodb locking
 

mongodb locking

클라우드 컴퓨팅 & NoSQL/MongoDB | 2014. 1. 2. 15:01 | Posted by 조대협

* Single write lock (per database)

* Reader-Writer lock :  allowing concurrent access to multiple threads for reading but restricting access to a single thread for writes (or other changes) to the resource


(from wikipedia) In computer science, a readers-writer or shared-exclusive lock (also known as the multiple readers / single-writer lock[1] or the multi-reader lock,[2] or by typographical variants such as readers/writers lock) is a synchronization primitive that solves one of the readers-writers problems. A readers-writer lock is like a mutex, in that it controls access to a shared resource, allowing concurrent access to multiple threads for reading but restricting access to a single thread for writes (or other changes) to the resource. A common use might be to control access to a data structure in memory that can't be updated atomically and isn't valid (and shouldn't be read by another thread) until the update is complete.


* Yield lock 

 - from version 2.0 if page fault has been occured in mongod (data is not loaded to memory). It yield lock 

 - long running read locks will ield periodically to ensure that write operations have the opportunity to complete. 


* Sharding & Locking : the lock is not shared across the shard. each shard has its own locking

* Replication & Locking

 - Primary to secondary replication is done by batch way. it copies oplog to secondary and run it as a batch. 


참고 : mongodb FAQ/locking

본인은 구글 클라우드의 직원이며, 이 블로그에 있는 모든 글은 회사와 관계 없는 개인의 의견임을 알립니다.

댓글을 달아 주세요