DICL / CCEH

Other
96 stars 30 forks source link

About R/W lock #9

Open heejin5178 opened 3 years ago

heejin5178 commented 3 years ago

I have a question about the locking scheme of CCEH. I read the "CCEH_MSB.cpp" code and found exclusive lock is the same as the shared lock. Each line is 193 and 392. Followed by the research paper, you used R/W lock. However, it seems that the lock that you used in "Insert" is shared, not exclusive. As far as I understand, "suspend" is worked as an exclusive lock. I wonder whether I misunderstood your code or not. Thank you.

chahk0129 commented 3 years ago

Thanks for your interest in our project. You’re correct about the locking scheme. The current implementation of CCEH uses a shared lock for optimization and handles write-write conflicts with an additional CAS of the most significant 8 bytes in the target key to a SENTINEL value. In case of a segment split, it holds an exclusive lock and waits until all the ongoing readers and writers finish.

heejin5178 commented 3 years ago

First of all, I really appreciated your fast reply. And I want to ask about R-W consistency. Followed by paper, when you use lazy deletion, CCEH can guarantee strong consistency. However, if a shared lock is used for normal insert(not split, doubling), how can CCEH guarantee consistency between read and write under concurrent mixed workload?