KIO split (from the Job side)

Mirko Boehm mirko at kde.org
Tue Apr 18 18:26:12 BST 2006


On Tuesday 18 April 2006 18:23, Kevin Krammer wrote:
> > Hm, what about ThreadWeaver, IIRC it has a job class as well? Would be
> > cool if KJobs and ThreadWeaver jobs would be at least compatible, using
> > diffrent job systems inside each other is ugly, I know that from KNode
> > ;-)
>
> I discussed it a bit with Mirko, as far as I know it has mostly an impact
> on the scheduling of jobs, it's something not imposed by KJob. Currently I
> only want KJob to force a consistent job interface, scheduling and the way
> they are executed is a slightly different problem.
> I agree that at one point we'll surely want to address this, but it needs
> some refactoring first in order to use ThreadWeaver correctly (IMHO
> removing the UI specific parts of jobs is of importance here).

I think that Kevin is trying to achieve something different. He is trying to 
define the interface for KIO jobs, while ThreadWeaver sees the Job class as 
an executable action much like Java's Runnable. ThreadWeaver queues can run 
KIO Jobs if they are executable this way, no matter what additional 
interfaces they add. 

On the other hand, when trying to implement sub-jobs, I do not think that it 
is possible to abstract from the scheduling or queueing. At least not easily 
and in an elegant way. 

It should be possible to derive KIO::Job from ThreadWeaver::Job, though, 
because it is very atomic. If this can be done right now, we will gain some 
nice flexibility.

ThreadWeaver's Job class can have sub-jobs, which is implemented in the way 
that every job is able to enqueue jobs at the time it is enqueued. This works 
out nicely. I have just finished (and committed) JobCollections and 
JobSequences, which make use of that feature and seem to be a interesting 
abstraction. The idea of subjobs should be already contained in that concept. 
Have a look at the unit tests in threadweaver/Tests to see how it works. 

I am convinced that a command pattern does only make sense if it includes the 
option to run it in another thread, see Java's Runnable. We should make this 
happen. 

--Mirko.
-- 
KDE e.V.: http://ev.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060418/a37ce522/attachment.sig>


More information about the kde-core-devel mailing list