krareT / pub-task

Terark public developing
MIT License
3 stars 6 forks source link

Brute force & simple stupid concurrent MemTable #36

Closed rockeet closed 5 years ago

rockeet commented 5 years ago

Create an instance-thread-local Sub-MemTable for such MemTable, such MemTable is optimized for write and has read amplification.

We first implement such MemTable on top of PatriciaTrie

Once MemTable is not a bottle neck, the advantage of distributed compaction will be shown more...

rockeet commented 5 years ago

另一个问题:创建一个线程,写几条数据,然后退出线程,会导致数量巨大的 Sub-MemTable。 这个问题可以这样解决: 因为每个线程退出时,它对应的 instance_tls 对象会析构,在这个对象的析构过程中,我们可以做一些工作:如果是第一次析构(第一个线程退出),啥都不干,如果是后续其它线程的析构,就尝试与之前析构的线程对应的 instance_tls Sub-MemTable 进行合并。

------ 这个问题优先级较低,先实现其他功能

rockeet commented 5 years ago

Done!