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

List:       kde-devel
Subject:    Re: threading in kde
From:       Andrew Sutton <ansutton () sep ! com>
Date:       2001-08-30 19:57:17
[Download RAW message or body]

>
> Looks like this (from my mail client code):
>
> This method IS the thread. EmpathMailbox::writeMessage() is blocking -
> but we don't care, because we're in a thread. When the write is
> complete, the object that created the job gets an
> EmpathMessageWrittenEvent.

something similar anyway. i'm actually thinking of something a little more 
powerful then just a single thread running a single method. that can be a 
little tedious to write.

the active object pattern from ACE defines a task as - for the most part an 
object with a thread, but you can do some pretty cool stuff with it. each 
task has an internal message queue that you can use to stack tasks together - 
or at least push msgs in and get something done.

you can also define methods that have asynchronous results (call this method, 
block until a result is available later).

there's some other really weird shit too - something about using a stream to 
string a message through a list of inter-connected tasks. i think that's more 
applicable to protocol development, but its a pretty powerful abstraction.

> I think it would be great to introduce an abstracted version of this
> concept into KDE somewhere, I just hadn't thought about doing that :)

i'd written a small version of exactly what you were talking about for the 
project i'm working on now. then we started using ACE and it all went away. 
i'd be interested in taking some aspects of ACE and writing them into a 
smallish threading library, but i don't know alot about kde development, so 
i'd definitely need a guiding hand. except with the c++ - i've got that down 
;)

> That was my original intention with Empath, but I had to stop when we
> decided not to use QThread for 2.x. I went to start working on it again
> for KDE 3, but then a company offered to pay me to work on their own
> mail client software, so I stopped and waited for a contract.. but,
> it appears the company have changed their minds :(

sorry about the luck...

Andrew Sutton
ansutton@sep.com
 
>> 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