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

List:       kde-devel
Subject:    Re: KDE & Multithreading
From:       Jay Cornwall <jay () evilrealms ! demon ! co ! uk>
Date:       2002-02-09 18:43:12
[Download RAW message or body]

On Saturday 09 February 2002 12:43 am, Charles Samuels wrote:

> > I'm writing a multithreaded KDE application at the moment, which needs to
> > be able to access the GUI (changing the status bar, lighting an LED,
> > etc.) from different threads. [..]

> So, I assume you're using the posix network calls (and not the Qt ones),
> since the Qt ones are all non-blocking, and require an event loop to
> select() the file descriptor. (btw, QSocketDevice doesn't need an event
> loop).  Anything that needs an event loop needs to be in the main thread.

Yes, I'm using the POSIX socket functions. To be honest, I've never really 
liked the way QT tries to abstract almost everything into classes. It seems 
unnecessary to me, and in some cases makes the code more cluttered than 
otherwise. Then again, I've never really been a fan of OO programming. ;)

> You can have your second (network) thread send messages to the main thread
> (e.g., progress info) via QThread::postEvent.

Ah, that seems to be what I'm looking for. But, oh, look, another example of 
annoying abstraction. Damn, I hate QT sometimes. Guess I can work around it. 
:/

> Instead of postEvent, you can also use ITC (www.derkarl.org/itc), which was
> written by me.  it is much faster than postEvent, and is especially nice
> for cases where you have an interface on a second thread.  But I only say
> this because I love "advertising" ITC ;)

I'll take a look. :)

Cheers,
Jay
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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