[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: branches/work/kviewshell-0.7/kviewshell/plugins [POSSIBLY UNSAFE]
From:       Thiago Macieira <thiago.macieira () trolltech ! com>
Date:       2006-05-28 14:16:41
Message-ID: 200605281616.42093.thiago.macieira () trolltech ! com
[Download RAW message or body]


Wilfried Huss wrote:
>Am Sonntag, 28. Mai 2006 11:49 schrieb Thiago Macieira:
>> Wilfried Huss wrote:
>> >One sometimes gets a "Xlib: unexpected async reply (sequence
>> > 0x8c56)!" message, and then the GUI freezes. This doesn't happen in
>> > trunk with Qt4/KDE4.
>>
>> This means you're doing GUI stuff from outside the GUI thread.
>
>Yes I know, I just don't know where I do GUI stuff.
>
>Does KProcIO make some xlib calls? Because other that that I only use
>QImage, QByteArray, KTempFile, QString, QStringList, QFile, QFileInfo
>and QDataStream.

KProcIO uses QSocketNotifiers (inside KProcess), so you're not allowed to 
use it non-GUI threads.

Depending on your KDE version, KProcess also calls QApplication::flushX(). 
I removed that call in KDE 3.5.3 and 4.0.

>> Remember that you are not allowed to use QObject objects outside the
>> GUI thread either in Qt 3!
>
>Why? From the Qt3 docs: "The QObject class itself is reentrant. However,
> certain rules apply when creating and using QObjects in a thread that
> is not the GUI thread."
>
>Or: "The Signals and Slots mechanism can be used in separate threads,
> ...".

Signals are delivered on the thread they are emitted. But the signal-slot 
connection list is not protected by mutex in Qt3, so you're not allowed 
to call QObject::connect or emit a signal unless you've locked the entire 
program yourself.

-- 
Thiago José Macieira - thiago.macieira AT trolltech.com
Trolltech AS - Sandakerveien 116, NO-0402 Oslo, Norway

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic