[Lazarus] Threads and Libraries (dll and so)
Sven Barth
pascaldragon at googlemail.com
Tue Feb 4 15:48:26 CET 2014
Am 04.02.2014 14:04, schrieb Michael Schnell:
> On 02/04/2014 01:39 PM, Sven Barth wrote:
>> Upon creation of the QApplication class it remembers the thread ID
>> and every GUI widget is checked that it is owned by this thread ID as
>> well. Certain events like rendering are also checked for the thread ID.
>>
> While I don't exactly see the point (as each thread of the application
> will have it's own thread id and thus should be handled as
> "unrelated"), I am sure that you do know what you say, denying the
> possibility in question.
When you call a method of a widget that results in some GUI related
stuff Qt checks the current thread ID against the thread ID the
QApplication was created in (or more precisely: the thread ID the event
loop is running in) using an Assert. While there can be multiple event
loops in Qt and there can be signal passing across threads it is not
possible to have more than one active GUI event loop.
> Anyway this is really bad news regarding the performance of KDE, QT
> etc (and consequence the LCL) on multiprocessor systems:
I agree with Michael van Canneyt that I don't even remotely see the need
for multi threaded GUIs.
Regards,
Sven
More information about the Lazarus
mailing list