why does qmap uses skiplist instead ob rb

I wounder why does QMap realised over skiplist data-structure and not rb-tree? There is very interesting SO thread about concurrency data-structs and skip-list benefits over rb-tree, pros and cons. It is indeed VERY interesing dialog with helpfull links, but QMap is not thread safe, it doesnt do any mutex locking for syncing access out of the box. It requires wrapper or subclassing.

For me its not simplier to write "hand-made" skiped list instead of rb-tree, so this is not obvious either.

Is there any kill-feature in context of non thread-safe Qt container?

Tnx in advance.


I once thought too that QMap is designed to be thread-safe and thus implemented as a skip list based dictionary. Apparently this doesn't seem to be the reason. It is much simpler: "Less code in the executable and less memory per node."

Indeed, QMap once was implemented as a RB-tree.

Source: Qt Quarterly 19, Section "Associative Containers"

链接地址: http://www.djcxy.com/p/11254.html

上一篇: 如何为自定义配置文件添加配置转换?

下一篇: 为什么qmap使用skiplist而不是ob rb