[Qt-interest] Qt and TLSF

RZ rz at razfazz.at
Fri May 29 01:31:20 CEST 2009


Arnold Krille schrieb:
> On Thursday 28 May 2009 21:55:10 RZ wrote:
>> in one of our projects we are using TLSF (Memory Allocator for
>> Real-Time). Also a Qt application (including GUI) is compiled and run
>> using TLSF.
>> But we had to notice are very unstable behaviour (a lot of random
>> crashes inside the Qt libraries). Does anybody have experiences using
>> such memory allocators with Qt? Or is this even impossible?
> 
> I haven't yet used anything else then the standard memory allocators. But: 
> "Weird crashes" in combination with real-time and most probably multiple 
> threads does ring the "thread safety" bell.
> While most of Qt is reentrant, only very few parts are thread safe. So you 
> have to add lots of mutexes/locks or, when moving data between threads, I went 
> for the fast shallow copies with atomic reference counting to pass data-
> pointers encapsulated in references.
> 
Thx, but maybe I'll have to be more precise.
The application is stable when TLSF is not used (and for different 
reasons the whole threading/mutex/.. stuff is implemented by ourselves 
and no Qt classes are used).

I don't have a trace at hand but with weird crashes i meant that e.g. 
something like QFileDialog::getSaveFileName() often lead to a crash, or 
inside QWidget::update() or reading a value from a QHash ...
All these occasional errors disappeared when _not_ using TLSF.

Compared to that passing data around was no problem ;-)




More information about the Qt-interest-old mailing list