[Digikam-devel] [Bug 133026] crashes on systems using hyperthreading

Martin Aumueller aumuell at reserv.at
Thu Aug 31 20:39:02 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=133026         




------- Additional Comments From aumuell reserv at  2006-08-31 21:39 -------
I'm pretty sure that such issues (as in this bug report just as in Amarok's case - http://bugs.kde.org/show_bug.cgi?id=99199) are not cause by hyperthreading. Instead, hyperthreading exposes other issues (unsafe use of QStrings - the reference counter for its implicit sharing might be accessed simultaneously from multiple threads, ...) in the code.

One possible explanation why mere SMP systems (and hyperthreading should appear to the application just as such a system) don't trigger these bugs so often could be the following:
- in a SMP system, when the same memory address is accessed (for writing) from multiple, the corresponding cache line has to be committed from the CPU's cache back to main memory and ownership has to be transferred to the other CPU wanting to write - a relatively slow process
- in a hyperthreading system, this does not have to happen, as there is only one CPU with only one cache, it's just that this CPU is used by two threads almost simultaneously, as control shifts from one virtual CPU to the other without OS intervention very very often
I think this can increase the probability of two threads accessing the same memory address at the same time quite a lot.

I hope that Qt4 will make these kind of problems mostly go away, as the implicit sharing will be really invisible to the user. In Qt3 you have to use QDeepCopy when passing QStrings between threads - which is really painful to get right in all cases.



More information about the Digikam-devel mailing list