Synchronization for multiple readers, single writer?

后端 未结 7 535
余生分开走
余生分开走 2021-01-01 01:32

Another synchronization question...I hope you guys don\'t get annoyed ;)

Assume the following scenario: one central data structure (very large, so I don\'t really wa

7条回答
  •  伪装坚强ぢ
    2021-01-01 01:56

    Whenever writer wants to access, you enqueue incoming readers (have them wait on Condition), wait for the active readers to finish, write and when finished let the enqueued readers access.

提交回复
热议问题