Why does qmap use skiplist instead of ob rb-tree?

I understand why QMap implemented the skiplist data structure, not rb-tree? There is a very interesting SO stream about concurrency data structures and the advantages of skipping for rb-tree, pluses and minuses. This is a VERY interesting dialogue with useful links, but QMap is not thread safe, it does not lock the mutex to synchronize access from the box. This requires a wrapper or subclass.

It’s not easier for me to write β€œhand-made” skiped list instead of rb-tree, so this is not obvious either.

Is there any kill function in the context of a Qt container without a ceiling?

Tnx in advance.

+7
source share
1 answer

I also thought that QMap is designed to be thread safe and thus implemented as a skip-based dictionary. This is apparently not the reason. This is much simpler: "Less code in the executable and less memory per node."

Indeed, QMap was once implemented as an RB tree.

Source: Qt Quarterly 19, Associative Containers Section

+3
source

All Articles