Open luodw opened 8 years ago
Double Buffers is a common method to improve application's performance, If we use only one immutable vector for memtable, we should be include more locks to protect this immutable. On the other hand, What should we do in which user inserts new key-value pair when we dumping the immutable.
If we insert into leveldb quickly , the memtable will be also full quickly, but if the immutable do not write to disk, the main thread will be blocked to wait imm=NULL ;
So i want know why not use a immutable vector, when memtable is full ,it will be insert into immutable vector; therefore ,the main thread can not be blocked;
i know there is a background thread to dump imm, it schedule the task, so i think why not use this thread to solve the immutable vector?maybe set more background thread? just like main thread produce immutables and the backgraound threads to dump them.
thank you!