5 ms·
@sghemawat: Are you planning on implementing atomic CAS operations?
by Emore 15y ago
@sghemawat: Are you planning on implementing atomic CAS operations?
- sghemawat 15y agoWe have no such plans. The library is designed so that concurrency control is outside its scope. If I needed it for an application, I might consider using some application level code that looks like: bool CAS(db, key, oldvalue, newvalue) { lock some mutex; read key's value from db; bool result = (value == oldvalue); if (result) write key=>newvalue to db; unlock; return result; } This should be not much slower than any hard-wired CAS we could provide from inside leveldb.
- deleted 15y ago[deleted]