skyzh/mini-lsm

RLock or WLock when we do a put/deletion?

El-even-11 opened this issue · 3 comments

In docs, it says that we should take a write lock when we do a put/deletion:

extra-tasks

But in reference solution, we take a read lock actually:

line109 and line119

It seems that RLock is enough, because MemTable is concurrent safe?

skyzh commented

You are correct. The lock is actually used to protect lost of memtables instead of the memtable itself.

skyzh commented

Lost -> list

skyzh commented

Will be fixed shortly…